<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>采购项目管理后台系统</title>
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css" />
    <script src="https://unpkg.com/vue@2/dist/vue.js"></script>
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <script src="https://unpkg.com/echarts@5.4.3/dist/echarts.min.js"></script>
    <style>
      body {
        margin: 0;
        padding: 0;
        font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB',
          'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
        background-color: #f5f5f5;
      }

      .admin-layout {
        display: flex;
        height: 100vh;
        min-height: 100vh;
      }

      .sidebar {
        width: 200px;
        min-width: 200px;
        background-color: #304156;
        color: white;
        overflow-y: auto;
        flex-shrink: 0;
      }

      .sidebar-header {
        padding: 20px;
        text-align: center;
        border-bottom: 1px solid #434a50;
      }

      .sidebar-title {
        font-size: 18px;
        font-weight: bold;
        color: white;
      }

      .sidebar-menu {
        padding: 0;
        margin: 0;
      }

      .menu-group {
        margin-bottom: 10px;
      }

      .menu-group-title {
        padding: 10px 20px;
        font-size: 12px;
        color: #a0a8b0;
        text-transform: uppercase;
        letter-spacing: 1px;
      }

      .menu-item {
        display: block;
        padding: 12px 20px;
        color: #bfcbd9;
        text-decoration: none;
        transition: all 0.3s;
        cursor: pointer;
        border-left: 3px solid transparent;
      }

      .menu-item:hover {
        background-color: #263445;
        color: white;
      }

      .menu-item.active {
        background-color: #409eff;
        color: white;
        border-left-color: #66b1ff;
      }

      .main-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-width: 0;
        overflow: hidden;
      }

      .top-header {
        height: 56px;
        background-color: white;
        border-bottom: 1px solid #e6e6e6;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 20px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
      }

      .breadcrumb {
        display: flex;
        align-items: center;
      }

      .user-info {
        display: flex;
        align-items: center;
        gap: 15px;
      }

      .content-area {
        flex: 1;
        padding: 20px;
        overflow-y: auto;
        background-color: #f5f5f5;
        min-height: 0;
      }

      .page-container {
        background: white;
        border-radius: 4px;
        padding: 20px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        min-height: calc(100vh - 120px);
      }

      .page-title {
        font-size: 24px;
        font-weight: bold;
        margin-bottom: 20px;
        color: #303133;
      }

      .page-section {
        background: white;
        border-radius: 4px;
        padding: 20px;
        margin-bottom: 20px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
      }

      .section-title {
        font-size: 18px;
        font-weight: bold;
        margin-bottom: 15px;
        color: #606266;
        border-bottom: 2px solid #409eff;
        padding-bottom: 8px;
      }

      .form-row {
        display: flex;
        gap: 20px;
        margin-bottom: 20px;
      }

      .form-row .el-form-item {
        flex: 1;
      }

      .stats-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
        margin-bottom: 20px;
      }

      .stat-card {
        background: white;
        border-radius: 8px;
        padding: 20px;
        text-align: center;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      }

      .stat-number {
        font-size: 32px;
        font-weight: bold;
        color: #409eff;
        margin-bottom: 8px;
      }

      .stat-label {
        font-size: 14px;
        color: #909399;
      }

      .chart-container {
        height: 300px;
        margin: 20px 0;
      }

      .timeline-container {
        margin: 20px 0;
      }

      .config-matrix {
        margin: 20px 0;
      }

      .config-matrix .el-table th {
        background-color: #f5f7fa;
        font-weight: bold;
      }

      .overdue-row {
        background-color: #fef0f0 !important;
      }

      .overdue-row:hover {
        background-color: #fde2e2 !important;
      }

      .warning-high {
        color: #f56c6c;
        font-weight: bold;
      }

      .warning-medium {
        color: #e6a23c;
        font-weight: bold;
      }

      .warning-low {
        color: #909399;
      }

      .step-content {
        min-height: 400px;
      }

      .project-tree {
        max-height: 400px;
        overflow-y: auto;
      }

      .project-detail-header {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        padding: 20px;
        border-radius: 8px;
        margin-bottom: 20px;
      }

      .project-detail-title {
        font-size: 24px;
        font-weight: bold;
        margin-bottom: 10px;
      }

      .project-detail-meta {
        display: flex;
        gap: 30px;
        flex-wrap: wrap;
      }

      .project-detail-meta-item {
        display: flex;
        flex-direction: column;
      }

      .project-detail-meta-label {
        font-size: 12px;
        opacity: 0.8;
        margin-bottom: 4px;
      }

      .project-detail-meta-value {
        font-size: 16px;
        font-weight: 500;
      }

      .hidden {
        display: none;
      }

      .table-container {
        overflow-x: auto;
        width: 100%;
      }

      .table-container .el-table {
        min-width: 1200px;
      }

      .allocation-cards {
        display: flex;
        gap: 20px;
        margin-bottom: 30px;
      }

      .allocation-card {
        flex: 1;
        border: 1px solid #e6e6e6;
        border-radius: 8px;
        background: white;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
      }

      .card-header {
        background: #f8f9fa;
        padding: 15px 20px;
        border-bottom: 1px solid #e6e6e6;
        display: flex;
        align-items: center;
        gap: 8px;
        font-weight: 500;
        color: #333;
      }

      .card-content {
        padding: 20px;
      }

      .allocated-info {
        display: flex;
        flex-direction: column;
        gap: 12px;
      }

      .info-item {
        display: flex;
        align-items: center;
        gap: 10px;
      }

      .info-item .label {
        font-weight: 500;
        color: #666;
        min-width: 80px;
      }

      .info-item .value {
        color: #333;
        font-weight: 400;
      }

      .allocation-rules {
        background: #f8f9fa;
        border: 1px solid #e6e6e6;
        border-radius: 6px;
        padding: 20px;
      }

      .rules-title {
        font-weight: 500;
        color: #333;
        margin-bottom: 12px;
        font-size: 14px;
      }

      .rules-content p {
        margin: 8px 0;
        color: #666;
        font-size: 13px;
        line-height: 1.5;
      }

      .stage-cell {
        padding: 8px 4px;
        text-align: center;
        font-size: 12px;
      }

      .stage-status {
        margin-bottom: 4px;
      }

      .stage-time {
        margin-bottom: 4px;
        line-height: 1.2;
      }

      .time-item {
        font-size: 11px;
        color: #666;
        margin-bottom: 2px;
      }

      .stage-duration {
        font-size: 11px;
        color: #999;
        margin-bottom: 2px;
      }

      .overdue-info {
        margin-top: 4px;
      }

      .overdue-text {
        color: #f56c6c;
        font-weight: bold;
        font-size: 11px;
      }

      .overdue-tag {
        background-color: #fef0f0 !important;
        border-color: #f56c6c !important;
        color: #f56c6c !important;
      }

      .overdue-row {
        background-color: #fef0f0 !important;
      }

      .overdue-row:hover > td {
        background-color: #fde2e2 !important;
      }

      /* 环节时限配置表格首列冻结样式 */
      .table-container .el-table .el-table__fixed-left {
        box-shadow: 2px 0 6px rgba(0, 0, 0, 0.1);
        z-index: 10;
        position: absolute !important;
        left: 0 !important;
      }

      .table-container .el-table .el-table__fixed-left .el-table__fixed-body-wrapper {
        background-color: #fff;
      }

      .table-container .el-table .el-table__fixed-left .el-table__fixed-header-wrapper {
        background-color: #f5f7fa;
      }

      .table-container
        .el-table
        .el-table__fixed-left
        .el-table__fixed-body-wrapper
        .el-table__body
        tr:hover
        > td {
        background-color: #f5f7fa !important;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <div class="admin-layout">
        <!-- 左侧导航栏 -->
        <div class="sidebar">
          <div class="sidebar-header">
            <div class="sidebar-title">采购管理系统</div>
          </div>
          <div class="sidebar-menu">
            <div class="menu-group">
              <div class="menu-group-title">项目管理</div>
              <a
                class="menu-item"
                :class="{active: currentPage === 'project-list'}"
                @click="switchPage('project-list')"
              >
                <i class="el-icon-s-order"></i>
                项目列表
              </a>
              <a
                class="menu-item"
                :class="{active: currentPage === 'project-create'}"
                @click="switchPage('project-create')"
              >
                <i class="el-icon-plus"></i>
                新建项目
              </a>
              <!-- <a
                class="menu-item"
                :class="{active: currentPage === 'project-detail'}"
                @click="switchPage('project-detail')"
              >
                <i class="el-icon-view"></i>
                项目详情
              </a> -->
            </div>

            <div class="menu-group">
              <div class="menu-group-title">统计分析</div>
              <a
                class="menu-item"
                :class="{active: currentPage === 'summary-stats'}"
                @click="switchPage('summary-stats')"
              >
                <i class="el-icon-data-analysis"></i>
                汇总统计
              </a>
              <a
                class="menu-item"
                :class="{active: currentPage === 'detail-stats'}"
                @click="switchPage('detail-stats')"
              >
                <i class="el-icon-s-data"></i>
                明细统计
              </a>
              <a
                class="menu-item"
                :class="{active: currentPage === 'warning-stats'}"
                @click="switchPage('warning-stats')"
              >
                <i class="el-icon-warning"></i>
                预警统计
              </a>
            </div>

            <div class="menu-group">
              <div class="menu-group-title">系统配置</div>
              <a
                class="menu-item"
                :class="{active: currentPage === 'time-config'}"
                @click="switchPage('time-config')"
              >
                <i class="el-icon-time"></i>
                环节时限配置
              </a>
              <a
                class="menu-item"
                :class="{active: currentPage === 'agent-management'}"
                @click="switchPage('agent-management')"
              >
                <i class="el-icon-s-custom"></i>
                招标代理管理
              </a>
              <!-- 用户权限管理菜单已隐藏 -->
              <!-- <a
                class="menu-item"
                :class="{active: currentPage === 'user-management'}"
                @click="switchPage('user-management')"
              >
                <i class="el-icon-user"></i>
                用户权限管理
              </a> -->
            </div>
          </div>
        </div>

        <!-- 主内容区域 -->
        <div class="main-content">
          <!-- 顶部导航栏 -->
          <div class="top-header">
            <div class="breadcrumb">
              <el-breadcrumb separator="/">
                <el-breadcrumb-item>{{ breadcrumb.main }}</el-breadcrumb-item>
                <el-breadcrumb-item v-if="breadcrumb.sub">{{ breadcrumb.sub }}</el-breadcrumb-item>
              </el-breadcrumb>
            </div>
            <div class="user-info">
              <span>欢迎，管理员</span>
              <el-dropdown>
                <span class="el-dropdown-link">
                  <i class="el-icon-user"></i>
                  <i class="el-icon-arrow-down el-icon--right"></i>
                </span>
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item>个人设置</el-dropdown-item>
                  <el-dropdown-item>修改密码</el-dropdown-item>
                  <el-dropdown-item divided>退出登录</el-dropdown-item>
                </el-dropdown-menu>
              </el-dropdown>
            </div>
          </div>

          <!-- 内容区域 -->
          <div class="content-area">
            <div class="page-container">
              <!-- 项目列表页面 -->
              <div v-show="currentPage === 'project-list'" class="page-content">
                <div class="page-title">项目列表</div>
                <!-- 搜索和筛选区域 -->
                <div class="page-section">
                  <el-form :inline="true" :model="searchForm" class="demo-form-inline">
                    <el-form-item label="项目名称">
                      <el-input
                        v-model="searchForm.keyword"
                        placeholder="请输入项目名称"
                        clearable
                      ></el-input>
                    </el-form-item>
                    <el-form-item label="项目状态">
                      <el-select v-model="searchForm.status" placeholder="请选择状态" clearable>
                        <el-option label="全部" value=""></el-option>
                        <el-option label="进行中" value="进行中"></el-option>
                        <el-option label="已完成" value="已完成"></el-option>
                        <el-option label="已暂停" value="已暂停"></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item label="采购方式">
                      <el-select v-model="searchForm.type" placeholder="请选择采购方式" clearable>
                        <el-option label="全部" value=""></el-option>
                        <el-option label="公开招标" value="公开招标"></el-option>
                        <el-option label="邀请招标" value="邀请招标"></el-option>
                        <el-option label="竞争性谈判" value="竞争性谈判"></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item>
                      <el-button type="primary" @click="handleSearch">查询</el-button>
                      <el-button @click="handleReset">重置</el-button>
                    </el-form-item>
                  </el-form>
                </div>

                <!-- 项目列表 -->
                <div class="page-section">
                  <div style="margin-bottom: 20px">
                    <el-button type="primary" @click="switchPage('project-create')">
                      <i class="el-icon-plus"></i>
                      新建项目
                    </el-button>
                    <el-button type="success" @click="batchImportUsers">
                      <i class="el-icon-upload"></i>
                      导入项目
                    </el-button>
                  </div>

                  <div class="table-container">
                    <el-table
                      :data="projectList"
                      style="width: 100%"
                      row-key="id"
                      :tree-props="{children: 'children'}"
                    >
                      <el-table-column
                        prop="name"
                        label="项目名称"
                        width="300"
                        show-overflow-tooltip
                      ></el-table-column>
                      <el-table-column prop="type" label="采购方式" width="120"></el-table-column>
                      <el-table-column prop="status" label="状态" width="100">
                        <template slot-scope="scope">
                          <el-tag :type="getStatusType(scope.row.status)">
                            {{ scope.row.status }}
                          </el-tag>
                        </template>
                      </el-table-column>
                      <el-table-column prop="progress" label="进度" width="120">
                        <template slot-scope="scope">
                          <el-progress
                            :percentage="scope.row.progress"
                            :show-text="false"
                          ></el-progress>
                          <span style="margin-left: 8px">{{ scope.row.progress }}%</span>
                        </template>
                      </el-table-column>
                      <el-table-column
                        prop="department"
                        label="负责部门"
                        width="120"
                      ></el-table-column>
                      <el-table-column
                        prop="manager"
                        label="项目经理"
                        width="100"
                      ></el-table-column>
                      <el-table-column
                        prop="startDate"
                        label="开始时间"
                        width="120"
                      ></el-table-column>
                      <el-table-column
                        prop="endDate"
                        label="预计完成"
                        width="120"
                      ></el-table-column>
                      <el-table-column label="操作" width="400" fixed="right">
                        <template slot-scope="scope">
                          <el-button size="mini" @click="viewProject(scope.row)">查看</el-button>
                          <el-button size="mini" type="primary" @click="editProject(scope.row)">
                            编辑
                          </el-button>
                          <el-button size="mini" type="warning" @click="rejectProject(scope.row)">
                            流标
                          </el-button>
                          <el-button size="mini" type="success" @click="completeProject(scope.row)">
                            办结
                          </el-button>
                          <el-button size="mini" type="danger" @click="terminateProject(scope.row)">
                            终止
                          </el-button>
                        </template>
                      </el-table-column>
                    </el-table>
                  </div>

                  <div style="margin-top: 20px; text-align: right">
                    <el-pagination
                      @size-change="handleSizeChange"
                      @current-change="handleCurrentChange"
                      :current-page="pagination.currentPage"
                      :page-sizes="[10, 20, 50, 100]"
                      :page-size="pagination.pageSize"
                      layout="total, sizes, prev, pager, next, jumper"
                      :total="pagination.total"
                    ></el-pagination>
                  </div>
                </div>
              </div>

              <!-- 项目创建页面 -->
              <div v-show="currentPage === 'project-create'" class="page-content">
                <div class="page-title">新建项目</div>

                <el-steps :active="createStep" finish-status="success" style="margin-bottom: 30px">
                  <el-step title="基本信息" description="填写项目基本信息"></el-step>
                  <el-step title="选取责任组" description="选择项目责任组"></el-step>
                </el-steps>

                <div class="step-content">
                  <!-- 第一步：项目信息录入 -->
                  <div v-show="createStep === 0">
                    <el-form
                      :model="projectForm"
                      :rules="projectRules"
                      ref="projectForm"
                      label-width="120px"
                    >
                      <div class="form-row">
                        <el-form-item label="采购项目名称" prop="name">
                          <el-input
                            v-model="projectForm.name"
                            placeholder="请输入采购项目名称"
                          ></el-input>
                        </el-form-item>
                        <el-form-item label="采购项目编号" prop="code">
                          <el-input
                            v-model="projectForm.code"
                            placeholder="请输入采购项目编号"
                          ></el-input>
                        </el-form-item>
                      </div>

                      <div class="form-row">
                        <el-form-item label="采购估算金额" prop="budget">
                          <el-input v-model="projectForm.budget" placeholder="请输入采购估算金额">
                            <template slot="append">万元</template>
                          </el-input>
                        </el-form-item>
                        <el-form-item label="采购方式" prop="type">
                          <el-select v-model="projectForm.type" placeholder="请选择采购方式">
                            <el-option label="公开招标" value="公开招标"></el-option>
                            <el-option label="竞争性磋商" value="竞争性磋商"></el-option>
                            <el-option label="邀请招标" value="邀请招标"></el-option>
                            <el-option label="竞争性谈判" value="竞争性谈判"></el-option>
                            <el-option label="单一来源" value="单一来源"></el-option>
                          </el-select>
                        </el-form-item>
                      </div>

                      <div class="form-row">
                        <el-form-item label="采购需求部门" prop="department">
                          <el-select
                            v-model="projectForm.department"
                            placeholder="请选择采购需求部门"
                          >
                            <el-option label="采购部" value="采购部"></el-option>
                            <el-option label="技术部" value="技术部"></el-option>
                            <el-option label="财务部" value="财务部"></el-option>
                            <el-option label="安全部" value="安全部"></el-option>
                          </el-select>
                        </el-form-item>
                        <el-form-item label="立项时间" prop="approvalDate">
                          <el-date-picker
                            v-model="projectForm.approvalDate"
                            type="date"
                            placeholder="请选择立项时间"
                            value-format="yyyy-MM-dd"
                            style="width: 100%"
                          ></el-date-picker>
                        </el-form-item>
                      </div>

                      <el-form-item label="备注" prop="description">
                        <el-input
                          type="textarea"
                          v-model="projectForm.description"
                          :rows="4"
                          placeholder="请输入其他补充说明"
                        ></el-input>
                      </el-form-item>
                    </el-form>
                  </div>

                  <!-- 第二步：选取项目责任组 -->
                  <div v-show="createStep === 1">
                    <div class="page-section">
                      <div class="section-title">选取项目责任组</div>

                      <el-form
                        :model="responsibilityForm"
                        :rules="responsibilityRules"
                        ref="responsibilityForm"
                        label-width="120px"
                      >
                        <div class="form-row">
                          <el-form-item label="项目责任组" prop="responsibilityGroup">
                            <el-select
                              v-model="responsibilityForm.responsibilityGroup"
                              placeholder="请选择项目责任组"
                              @change="onResponsibilityGroupChange"
                            >
                              <el-option label="责任组A" value="责任组A"></el-option>
                              <el-option label="责任组B" value="责任组B"></el-option>
                            </el-select>
                          </el-form-item>
                        </div>
                        <div class="form-row" v-if="showResponsibilityModifyReason">
                          <el-form-item
                            label="修改原因"
                            prop="responsibilityModifyReason"
                            :rules="[{ required: true, message: '请填写修改原因', trigger: 'blur' }]"
                          >
                            <el-input
                              v-model="responsibilityForm.modifyReason"
                              type="textarea"
                              placeholder="请填写修改原因"
                              :rows="3"
                            ></el-input>
                          </el-form-item>
                        </div>
                      </el-form>
                    </div>
                  </div>
                </div>

                <div style="text-align: center; margin-top: 30px">
                  <el-button v-if="createStep > 0" @click="prevStep">上一步</el-button>
                  <el-button v-if="createStep === 0" type="primary" @click="saveAndRandomGroup">
                    保存并随机项目组
                  </el-button>
                  <el-button v-if="createStep === 1" type="success" @click="submitProject">
                    完成创建
                  </el-button>
                  <el-button @click="goBack">取消</el-button>
                </div>
              </div>

              <!-- 项目详情页面 -->
              <div v-show="currentPage === 'project-detail'" class="page-content">
                <div class="page-title">项目详情</div>

                <!-- 项目基本信息 -->
                <div class="project-detail-header">
                  <div class="project-detail-title">江苏省分行办公设备采购项目</div>
                  <div class="project-detail-meta">
                    <div class="project-detail-meta-item">
                      <div class="project-detail-meta-label">项目编号</div>
                      <div class="project-detail-meta-value">CG2024001</div>
                    </div>
                    <div class="project-detail-meta-item">
                      <div class="project-detail-meta-label">采购方式</div>
                      <div class="project-detail-meta-value">公开招标</div>
                    </div>
                    <div class="project-detail-meta-item">
                      <div class="project-detail-meta-label">预算金额</div>
                      <div class="project-detail-meta-value">500万元</div>
                    </div>
                    <div class="project-detail-meta-item">
                      <div class="project-detail-meta-label">负责部门</div>
                      <div class="project-detail-meta-value">采购部</div>
                    </div>
                    <div class="project-detail-meta-item">
                      <div class="project-detail-meta-label">项目经理</div>
                      <div class="project-detail-meta-value">张经理</div>
                    </div>
                    <div class="project-detail-meta-item">
                      <div class="project-detail-meta-label">项目状态</div>
                      <div class="project-detail-meta-value">
                        <el-tag type="primary">进行中</el-tag>
                      </div>
                    </div>
                  </div>
                </div>

                <!-- 项目进度时间线 -->
                <div class="page-section">
                  <div class="section-title">项目进度</div>
                  <el-timeline>
                    <el-timeline-item timestamp="2024-01-15" placement="top">
                      <el-card>
                        <h4>项目启动</h4>
                        <p>项目正式启动，完成初步需求分析</p>
                      </el-card>
                    </el-timeline-item>
                    <el-timeline-item timestamp="2024-01-20" placement="top">
                      <el-card>
                        <h4>需求确认</h4>
                        <p>完成详细需求确认和技术规格制定</p>
                      </el-card>
                    </el-timeline-item>
                    <el-timeline-item timestamp="2024-02-01" placement="top">
                      <el-card>
                        <h4>招标文件发布</h4>
                        <p>招标文件正式发布，开始接受投标</p>
                      </el-card>
                    </el-timeline-item>
                    <el-timeline-item timestamp="2024-02-15" placement="top">
                      <el-card>
                        <h4>投标截止</h4>
                        <p>投标截止，开始评标工作</p>
                      </el-card>
                    </el-timeline-item>
                    <el-timeline-item timestamp="2024-02-28" placement="top">
                      <el-card>
                        <h4>评标完成</h4>
                        <p>评标工作完成，确定中标候选人</p>
                      </el-card>
                    </el-timeline-item>
                  </el-timeline>
                </div>

                <!-- 子项目列表 -->
                <div class="page-section">
                  <div class="section-title">子项目列表</div>
                  <div class="table-container">
                    <el-table :data="subProjects" style="width: 100%">
                      <el-table-column prop="name" label="子项目名称" width="200"></el-table-column>
                      <el-table-column prop="type" label="采购方式" width="120"></el-table-column>
                      <el-table-column prop="status" label="状态" width="100">
                        <template slot-scope="scope">
                          <el-tag :type="getStatusType(scope.row.status)">
                            {{ scope.row.status }}
                          </el-tag>
                        </template>
                      </el-table-column>
                      <el-table-column prop="progress" label="进度" width="120">
                        <template slot-scope="scope">
                          <el-progress
                            :percentage="scope.row.progress"
                            :show-text="false"
                          ></el-progress>
                          <span style="margin-left: 8px">{{ scope.row.progress }}%</span>
                        </template>
                      </el-table-column>
                      <el-table-column prop="manager" label="负责人" width="100"></el-table-column>
                      <el-table-column
                        prop="startDate"
                        label="开始时间"
                        width="120"
                      ></el-table-column>
                      <el-table-column
                        prop="endDate"
                        label="完成时间"
                        width="120"
                      ></el-table-column>
                      <el-table-column label="操作" width="200">
                        <template slot-scope="scope">
                          <el-button size="mini" @click="viewSubProject(scope.row)">查看</el-button>
                          <el-button size="mini" type="primary" @click="editSubProject(scope.row)">
                            编辑
                          </el-button>
                        </template>
                      </el-table-column>
                    </el-table>
                  </div>
                </div>
              </div>

              <!-- 汇总统计页面 -->
              <div v-show="currentPage === 'summary-stats'" class="page-content">
                <div class="page-title">汇总统计</div>

                <!-- 统计卡片 -->
                <div class="stats-grid">
                  <div class="stat-card">
                    <div class="stat-number">15</div>
                    <div class="stat-label">总项目数</div>
                  </div>
                  <div class="stat-card">
                    <div class="stat-number">8</div>
                    <div class="stat-label">进行中</div>
                  </div>
                  <div class="stat-card">
                    <div class="stat-number">5</div>
                    <div class="stat-label">已完成</div>
                  </div>
                  <div class="stat-card">
                    <div class="stat-number">2</div>
                    <div class="stat-label">已暂停</div>
                  </div>
                  <div class="stat-card">
                    <div class="stat-number">3,500</div>
                    <div class="stat-label">总预算(万元)</div>
                  </div>
                  <div class="stat-card">
                    <div class="stat-number">2,100</div>
                    <div class="stat-label">已使用(万元)</div>
                  </div>
                </div>

                <!-- 采购项目责任组/人分配统计表 -->
                <div class="page-section">
                  <div class="section-title">采购项目责任组/人分配统计表</div>
                  <div class="table-container">
                    <el-table :data="summaryGroupPersonTable" style="width: 100%" border>
                      <el-table-column
                        prop="name"
                        label="采购项目责任组/人"
                        min-width="160"
                      ></el-table-column>
                      <el-table-column
                        prop="assigned"
                        label="已分配项目数量"
                        min-width="130"
                      ></el-table-column>
                      <el-table-column
                        prop="completed"
                        label="已完成项目数量"
                        min-width="130"
                      ></el-table-column>
                      <el-table-column
                        prop="todo"
                        label="待办项目数量"
                        min-width="120"
                      ></el-table-column>
                      <el-table-column
                        prop="planPending"
                        label="采购方案待完成数量"
                        min-width="150"
                      ></el-table-column>
                      <el-table-column
                        prop="execPending"
                        label="采购实施待完成数量"
                        min-width="150"
                      ></el-table-column>
                    </el-table>
                  </div>
                </div>

                <!-- 招标代理机构分配采购项目统计表 -->
                <div class="page-section">
                  <div class="section-title">招标代理机构分配采购项目统计表</div>
                  <div class="table-container">
                    <el-table :data="summaryAgentTable" style="width: 100%" border>
                      <el-table-column prop="org" label="机构" min-width="160"></el-table-column>
                      <el-table-column
                        prop="assigned"
                        label="已分配项目数量"
                        min-width="140"
                      ></el-table-column>
                      <el-table-column
                        prop="completed"
                        label="已完成项目数量"
                        min-width="140"
                      ></el-table-column>
                      <el-table-column
                        prop="todo"
                        label="待办项目数量"
                        min-width="120"
                      ></el-table-column>
                    </el-table>
                  </div>
                </div>

                <!-- 采购方式及时效统计表 -->
                <div class="page-section">
                  <div class="section-title">采购方式及时效统计表</div>
                  <div class="table-container">
                    <el-table :data="summaryMethodTable" style="width: 100%">
                      <el-table-column
                        prop="method"
                        label="采购方式"
                        min-width="140"
                      ></el-table-column>
                      <el-table-column
                        prop="count"
                        label="项目数量"
                        min-width="110"
                      ></el-table-column>
                      <el-table-column
                        prop="amount"
                        label="项目金额(万元)"
                        min-width="150"
                      ></el-table-column>
                      <el-table-column
                        prop="avgDays"
                        label="全流程平均时长(天)"
                        min-width="170"
                      ></el-table-column>

                      <el-table-column label="流标">
                        <el-table-column
                          prop="failCount"
                          label="数量"
                          min-width="100"
                        ></el-table-column>
                        <el-table-column
                          prop="failRate"
                          label="率"
                          min-width="100"
                        ></el-table-column>
                      </el-table-column>

                      <el-table-column label="节资">
                        <el-table-column
                          prop="saveAmount"
                          label="金额"
                          min-width="100"
                        ></el-table-column>
                        <el-table-column
                          prop="saveRate"
                          label="率"
                          min-width="100"
                        ></el-table-column>
                      </el-table-column>

                      <el-table-column label="公开">
                        <el-table-column
                          prop="openBid"
                          label="招标"
                          min-width="100"
                        ></el-table-column>
                        <el-table-column
                          prop="openRate"
                          label="率"
                          min-width="100"
                        ></el-table-column>
                      </el-table-column>
                    </el-table>
                  </div>
                </div>
              </div>

              <!-- 明细统计页面 -->
              <div v-show="currentPage === 'detail-stats'" class="page-content">
                <div class="page-title">明细统计</div>

                <!-- 筛选条件 -->
                <div class="page-section">
                  <el-form :inline="true" :model="detailStatsFilter" class="demo-form-inline">
                    <el-form-item label="项目名称">
                      <el-input
                        v-model="detailStatsFilter.projectName"
                        placeholder="请输入项目名称"
                        clearable
                      ></el-input>
                    </el-form-item>
                    <el-form-item label="负责部门">
                      <el-select
                        v-model="detailStatsFilter.department"
                        placeholder="请选择部门"
                        clearable
                      >
                        <el-option label="全部" value=""></el-option>
                        <el-option label="采购部" value="采购部"></el-option>
                        <el-option label="技术部" value="技术部"></el-option>
                        <el-option label="财务部" value="财务部"></el-option>
                        <el-option label="安全部" value="安全部"></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item label="采购方式">
                      <el-select
                        v-model="detailStatsFilter.type"
                        placeholder="请选择采购方式"
                        clearable
                      >
                        <el-option label="全部" value=""></el-option>
                        <el-option label="公开招标" value="公开招标"></el-option>
                        <el-option label="邀请招标" value="邀请招标"></el-option>
                        <el-option label="竞争性谈判" value="竞争性谈判"></el-option>
                        <el-option label="单一来源" value="单一来源"></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item label="项目状态">
                      <el-select
                        v-model="detailStatsFilter.status"
                        placeholder="请选择状态"
                        clearable
                      >
                        <el-option label="全部" value=""></el-option>
                        <el-option label="进行中" value="进行中"></el-option>
                        <el-option label="已完成" value="已完成"></el-option>
                        <el-option label="已暂停" value="已暂停"></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item>
                      <el-button type="primary" @click="handleDetailStatsSearch">查询</el-button>
                      <el-button @click="handleDetailStatsReset">重置</el-button>
                      <el-button type="success" @click="exportDetailStats">导出Excel</el-button>
                    </el-form-item>
                  </el-form>
                </div>

                <!-- 项目明细统计表格 -->
                <div class="page-section">
                  <div class="section-title">项目明细统计</div>
                  <div class="table-container">
                    <el-table
                      :data="detailStatsList"
                      style="width: 100%; min-width: 2000px"
                      :row-class-name="getRowClassName"
                      :tree-props="{children: 'children'}"
                      :default-expand-all="true"
                      :expand-row-keys="[1, 3]"
                      row-key="id"
                      border
                    >
                      <!-- 固定列 -->
                      <el-table-column
                        prop="projectName"
                        label="项目名称"
                        width="200"
                        fixed="left"
                        show-overflow-tooltip
                      >
                        <template slot-scope="scope">
                          <div style="word-wrap: break-word; white-space: normal; line-height: 1.4">
                            {{ scope.row.projectName }}
                          </div>
                        </template>
                      </el-table-column>
                      <el-table-column
                        prop="projectCode"
                        label="项目编号"
                        width="120"
                      ></el-table-column>
                      <el-table-column prop="savingRate" label="节资率" width="100" align="center">
                        <template slot-scope="scope">
                          <span v-if="scope.row.savingRate">{{ scope.row.savingRate }}%</span>
                          <span v-else>-</span>
                        </template>
                      </el-table-column>
                      <el-table-column
                        prop="savingAmount"
                        label="节资金额"
                        width="120"
                        align="center"
                      >
                        <template slot-scope="scope">
                          <span v-if="scope.row.savingAmount">
                            {{ scope.row.savingAmount }}万元
                          </span>
                          <span v-else>-</span>
                        </template>
                      </el-table-column>
                      <el-table-column prop="type" label="采购方式" width="100"></el-table-column>
                      <el-table-column prop="manager" label="责任人" width="100"></el-table-column>
                      <el-table-column prop="status" label="项目状态" width="100">
                        <template slot-scope="scope">
                          <el-tag :type="getStatusType(scope.row.status)" size="small">
                            {{ scope.row.status }}
                          </el-tag>
                        </template>
                      </el-table-column>

                      <!-- 各环节进度列 -->
                      <el-table-column
                        v-for="stage in stageColumns"
                        :key="stage.key"
                        :label="stage.name"
                        :width="stage.width"
                        align="center"
                      >
                        <template slot-scope="scope">
                          <div class="stage-cell">
                            <div v-if="!scope.row.children" class="stage-status">
                              <el-tag
                                :type="getStageStatusType(scope.row.stages[stage.key].status)"
                                size="mini"
                                :class="{ 'overdue-tag': scope.row.stages[stage.key].isOverdue }"
                              >
                                {{ scope.row.stages[stage.key].status }}
                              </el-tag>
                            </div>
                            <div v-if="!scope.row.children" class="stage-time">
                              <div class="time-item">
                                开始：{{ scope.row.stages[stage.key].startTime }}
                              </div>
                              <div class="time-item">
                                完成：{{ scope.row.stages[stage.key].endTime }}
                              </div>
                            </div>
                            <div v-if="!scope.row.children" class="stage-duration">
                              <span v-if="scope.row.stages[stage.key].actualDuration !== '-'">
                                {{ scope.row.stages[stage.key].actualDuration }}天
                              </span>
                              <span v-else>-</span>
                            </div>
                            <div
                              v-if="!scope.row.children && scope.row.stages[stage.key].isOverdue"
                              class="overdue-info"
                            >
                              <span class="overdue-text">
                                超时{{ scope.row.stages[stage.key].overdueDays }}天
                              </span>
                            </div>
                            <div
                              v-if="scope.row.children"
                              style="color: #999; font-size: 12px; text-align: center"
                            >
                              -
                            </div>
                          </div>
                        </template>
                      </el-table-column>

                      <!-- 操作列 -->
                      <el-table-column label="操作" width="150">
                        <template slot-scope="scope">
                          <el-button
                            size="mini"
                            type="primary"
                            @click="handleStageProcess(scope.row)"
                          >
                            处理环节
                          </el-button>
                        </template>
                      </el-table-column>
                    </el-table>
                  </div>

                  <div style="margin-top: 20px; text-align: right">
                    <el-pagination
                      @size-change="handleDetailStatsSizeChange"
                      @current-change="handleDetailStatsCurrentChange"
                      :current-page="detailStatsPagination.currentPage"
                      :page-sizes="[10, 20, 50, 100]"
                      :page-size="detailStatsPagination.pageSize"
                      layout="total, sizes, prev, pager, next, jumper"
                      :total="detailStatsPagination.total"
                    ></el-pagination>
                  </div>
                </div>
              </div>

              <!-- 预警统计页面 -->
              <div v-show="currentPage === 'warning-stats'" class="page-content">
                <div class="page-title">预警统计</div>

                <!-- 预警概览 -->
                <div class="page-section">
                  <div class="section-title">预警概览</div>
                  <div class="stats-grid">
                    <div class="stat-card" style="border-left: 4px solid #e6a23c">
                      <div class="stat-number" style="color: #e6a23c">
                        {{ warningSummary.generalWarning }}
                      </div>
                      <div class="stat-label">一般预警</div>
                    </div>
                    <div class="stat-card" style="border-left: 4px solid #f56c6c">
                      <div class="stat-number" style="color: #f56c6c">
                        {{ warningSummary.abnormalWarning }}
                      </div>
                      <div class="stat-label">异常预警</div>
                    </div>
                    <div class="stat-card" style="border-left: 4px solid #409eff">
                      <div class="stat-number" style="color: #409eff">
                        {{ warningSummary.totalWarnings }}
                      </div>
                      <div class="stat-label">总预警数</div>
                    </div>
                  </div>
                </div>

                <!-- 筛选条件 -->
                <div class="page-section">
                  <el-form :inline="true" :model="warningFilter" class="demo-form-inline">
                    <el-form-item label="预警级别">
                      <el-select
                        v-model="warningFilter.level"
                        placeholder="请选择预警级别"
                        clearable
                      >
                        <el-option label="全部" value=""></el-option>
                        <el-option label="一般预警" value="general"></el-option>
                        <el-option label="异常预警" value="abnormal"></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item label="处理状态">
                      <el-select
                        v-model="warningFilter.status"
                        placeholder="请选择处理状态"
                        clearable
                      >
                        <el-option label="全部" value=""></el-option>
                        <el-option label="未处理" value="pending"></el-option>
                        <el-option label="处理中" value="processing"></el-option>
                        <el-option label="已处理" value="resolved"></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item>
                      <el-button type="primary" @click="handleWarningSearch">查询</el-button>
                      <el-button @click="handleWarningReset">重置</el-button>
                    </el-form-item>
                  </el-form>
                </div>

                <!-- 预警记录列表 -->
                <div class="page-section">
                  <div class="section-title">预警记录</div>
                  <div class="table-container">
                    <el-table :data="warningList" style="width: 100%">
                      <el-table-column
                        prop="projectName"
                        label="项目名称"
                        width="200"
                        show-overflow-tooltip
                      ></el-table-column>
                      <el-table-column prop="level" label="预警级别" width="100">
                        <template slot-scope="scope">
                          <span :class="getWarningLevelClass(scope.row.level)">
                            {{ scope.row.level }}
                          </span>
                        </template>
                      </el-table-column>
                      <el-table-column
                        prop="description"
                        label="预警描述"
                        width="250"
                        show-overflow-tooltip
                      ></el-table-column>
                      <el-table-column
                        prop="createTime"
                        label="预警时间"
                        width="150"
                      ></el-table-column>
                      <el-table-column
                        prop="deadline"
                        label="处理期限"
                        width="150"
                      ></el-table-column>
                      <el-table-column prop="status" label="处理状态" width="100">
                        <template slot-scope="scope">
                          <el-tag :type="getWarningStatusType(scope.row.status)">
                            {{ scope.row.status }}
                          </el-tag>
                        </template>
                      </el-table-column>
                      <el-table-column prop="handler" label="处理人" width="100"></el-table-column>
                    </el-table>
                  </div>

                  <div style="margin-top: 20px; text-align: right">
                    <el-pagination
                      @size-change="handleWarningSizeChange"
                      @current-change="handleWarningCurrentChange"
                      :current-page="warningPagination.currentPage"
                      :page-sizes="[10, 20, 50, 100]"
                      :page-size="warningPagination.pageSize"
                      layout="total, sizes, prev, pager, next, jumper"
                      :total="warningPagination.total"
                    ></el-pagination>
                  </div>
                </div>
              </div>

              <!-- 环节时限配置页面 -->
              <div v-show="currentPage === 'time-config'" class="page-content">
                <!-- 配置矩阵表格 -->
                <div class="page-section">
                  <div style="margin-bottom: 20px">
                    <div>
                      <el-button type="success" @click="saveAllConfigs">
                        <i class="el-icon-check"></i>
                        保存配置
                      </el-button>
                      <el-button @click="resetConfigs">
                        <i class="el-icon-refresh"></i>
                        重置配置
                      </el-button>
                    </div>
                  </div>

                  <div class="table-container" style="overflow-x: auto; width: 100%">
                    <el-table
                      :data="timeConfigData"
                      style="width: 1640px"
                      border
                      :header-cell-style="{ backgroundColor: '#f5f7fa', color: '#606266' }"
                    >
                      <el-table-column
                        prop="stage"
                        label="采购环节"
                        width="200"
                        fixed="left"
                      ></el-table-column>
                      <el-table-column label="时间单位" width="150" fixed="left">
                        <template slot-scope="scope">
                          <el-select
                            v-model="scope.row.timeUnit"
                            size="mini"
                            style="width: 100px"
                            @change="onTimeUnitChange(scope.row)"
                          >
                            <el-option label="工作日" value="工作日"></el-option>
                            <el-option label="天" value="天"></el-option>
                          </el-select>
                        </template>
                      </el-table-column>
                      <el-table-column label="公开招标" width="160">
                        <template slot-scope="scope">
                          <!-- 前两个环节显示 - -->
                          <div
                            v-if="
                              scope.row.stage === '采购立项及采购需求文件编制' ||
                              scope.row.stage === '集中采购需求申请接收'
                            "
                            style="text-align: center; color: #909399; font-size: 16px"
                          >
                            -
                          </div>
                          <div
                            v-else-if="scope.row.stage === '采购方案审批'"
                            style="padding: 8px 0"
                          >
                            <!-- 签报审批 -->
                            <div style="margin-bottom: 8px">
                              <div style="font-size: 11px; color: #666; margin-bottom: 4px">
                                签报审批
                              </div>
                              <div style="display: flex; align-items: center">
                                <el-input-number
                                  v-model="scope.row.openTenderReport"
                                  :min="0"
                                  :max="365"
                                  size="mini"
                                  @change="validateTimeConfig(scope.row, 'openTenderReport')"
                                  style="width: 100px"
                                ></el-input-number>
                                <span style="margin-left: 3px; font-size: 11px; color: #909399">
                                  天
                                </span>
                              </div>
                            </div>
                            <!-- 上会审批 -->
                            <div>
                              <div style="font-size: 11px; color: #666; margin-bottom: 4px">
                                上会审批
                              </div>
                              <div style="display: flex; align-items: center">
                                <el-input-number
                                  v-model="scope.row.openTenderMeeting"
                                  :min="0"
                                  :max="365"
                                  size="mini"
                                  @change="validateTimeConfig(scope.row, 'openTenderMeeting')"
                                  style="width: 100px"
                                ></el-input-number>
                                <span style="margin-left: 3px; font-size: 11px; color: #909399">
                                  天
                                </span>
                              </div>
                            </div>
                          </div>
                          <div
                            v-else
                            style="display: flex; align-items: center; white-space: nowrap"
                          >
                            <el-input-number
                              v-model="scope.row.openTender"
                              :min="1"
                              :max="365"
                              size="mini"
                              @change="validateTimeConfig(scope.row, 'openTender')"
                              style="width: 100px"
                            ></el-input-number>
                            <span style="margin-left: 5px; font-size: 12px; color: #909399">
                              天
                            </span>
                          </div>
                        </template>
                      </el-table-column>
                      <el-table-column label="公开竞争性磋商" width="160">
                        <template slot-scope="scope">
                          <!-- 前两个环节显示 - -->
                          <div
                            v-if="
                              scope.row.stage === '采购立项及采购需求文件编制' ||
                              scope.row.stage === '集中采购需求申请接收'
                            "
                            style="text-align: center; color: #909399; font-size: 16px"
                          >
                            -
                          </div>
                          <div
                            v-else-if="scope.row.stage === '采购方案审批'"
                            style="padding: 8px 0"
                          >
                            <!-- 签报审批 -->
                            <div style="margin-bottom: 8px">
                              <div style="font-size: 11px; color: #666; margin-bottom: 4px">
                                签报审批
                              </div>
                              <div style="display: flex; align-items: center">
                                <el-input-number
                                  v-model="scope.row.openCompetitiveConsultationReport"
                                  :min="0"
                                  :max="365"
                                  size="mini"
                                  @change="validateTimeConfig(scope.row, 'openCompetitiveConsultationReport')"
                                  style="width: 100px"
                                ></el-input-number>
                                <span style="margin-left: 5px; font-size: 12px; color: #909399">
                                  天
                                </span>
                              </div>
                            </div>
                            <!-- 上会审批 -->
                            <div>
                              <div style="font-size: 11px; color: #666; margin-bottom: 4px">
                                上会审批
                              </div>
                              <div style="display: flex; align-items: center">
                                <el-input-number
                                  v-model="scope.row.openCompetitiveConsultationMeeting"
                                  :min="0"
                                  :max="365"
                                  size="mini"
                                  @change="validateTimeConfig(scope.row, 'openCompetitiveConsultationMeeting')"
                                  style="width: 100px"
                                ></el-input-number>
                                <span style="margin-left: 5px; font-size: 12px; color: #909399">
                                  天
                                </span>
                              </div>
                            </div>
                          </div>
                          <div
                            v-else
                            style="display: flex; align-items: center; white-space: nowrap"
                          >
                            <el-input-number
                              v-model="scope.row.openCompetitiveConsultation"
                              :min="1"
                              :max="365"
                              size="mini"
                              @change="validateTimeConfig(scope.row, 'openCompetitiveConsultation')"
                              style="width: 100px"
                            ></el-input-number>
                            <span style="margin-left: 5px; font-size: 12px; color: #909399">
                              天
                            </span>
                          </div>
                        </template>
                      </el-table-column>
                      <el-table-column label="公开竞争性谈判" width="160">
                        <template slot-scope="scope">
                          <!-- 前两个环节显示 - -->
                          <div
                            v-if="
                              scope.row.stage === '采购立项及采购需求文件编制' ||
                              scope.row.stage === '集中采购需求申请接收'
                            "
                            style="text-align: center; color: #909399; font-size: 16px"
                          >
                            -
                          </div>
                          <div
                            v-else-if="scope.row.stage === '采购方案审批'"
                            style="padding: 8px 0"
                          >
                            <!-- 签报审批 -->
                            <div style="margin-bottom: 8px">
                              <div style="font-size: 11px; color: #666; margin-bottom: 4px">
                                签报审批
                              </div>
                              <div style="display: flex; align-items: center">
                                <el-input-number
                                  v-model="scope.row.openCompetitiveNegotiationReport"
                                  :min="0"
                                  :max="365"
                                  size="mini"
                                  @change="validateTimeConfig(scope.row, 'openCompetitiveNegotiationReport')"
                                  style="width: 100px"
                                ></el-input-number>
                                <span style="margin-left: 5px; font-size: 12px; color: #909399">
                                  天
                                </span>
                              </div>
                            </div>
                            <!-- 上会审批 -->
                            <div>
                              <div style="font-size: 11px; color: #666; margin-bottom: 4px">
                                上会审批
                              </div>
                              <div style="display: flex; align-items: center">
                                <el-input-number
                                  v-model="scope.row.openCompetitiveNegotiationMeeting"
                                  :min="0"
                                  :max="365"
                                  size="mini"
                                  @change="validateTimeConfig(scope.row, 'openCompetitiveNegotiationMeeting')"
                                  style="width: 100px"
                                ></el-input-number>
                                <span style="margin-left: 5px; font-size: 12px; color: #909399">
                                  天
                                </span>
                              </div>
                            </div>
                          </div>
                          <div
                            v-else
                            style="display: flex; align-items: center; white-space: nowrap"
                          >
                            <el-input-number
                              v-model="scope.row.openCompetitiveNegotiation"
                              :min="1"
                              :max="365"
                              size="mini"
                              @change="validateTimeConfig(scope.row, 'openCompetitiveNegotiation')"
                              style="width: 100px"
                            ></el-input-number>
                            <span style="margin-left: 5px; font-size: 12px; color: #909399">
                              天
                            </span>
                          </div>
                        </template>
                      </el-table-column>
                      <el-table-column label="公开比选" width="160">
                        <template slot-scope="scope">
                          <!-- 前两个环节显示 - -->
                          <div
                            v-if="
                              scope.row.stage === '采购立项及采购需求文件编制' ||
                              scope.row.stage === '集中采购需求申请接收'
                            "
                            style="text-align: center; color: #909399; font-size: 16px"
                          >
                            -
                          </div>
                          <div
                            v-else-if="scope.row.stage === '采购方案审批'"
                            style="padding: 8px 0"
                          >
                            <!-- 签报审批 -->
                            <div style="margin-bottom: 8px">
                              <div style="font-size: 11px; color: #666; margin-bottom: 4px">
                                签报审批
                              </div>
                              <div style="display: flex; align-items: center">
                                <el-input-number
                                  v-model="scope.row.openComparisonReport"
                                  :min="0"
                                  :max="365"
                                  size="mini"
                                  @change="validateTimeConfig(scope.row, 'openComparisonReport')"
                                  style="width: 100px"
                                ></el-input-number>
                                <span style="margin-left: 5px; font-size: 12px; color: #909399">
                                  天
                                </span>
                              </div>
                            </div>
                            <!-- 上会审批 -->
                            <div>
                              <div style="font-size: 11px; color: #666; margin-bottom: 4px">
                                上会审批
                              </div>
                              <div style="display: flex; align-items: center">
                                <el-input-number
                                  v-model="scope.row.openComparisonMeeting"
                                  :min="0"
                                  :max="365"
                                  size="mini"
                                  @change="validateTimeConfig(scope.row, 'openComparisonMeeting')"
                                  style="width: 100px"
                                ></el-input-number>
                                <span style="margin-left: 5px; font-size: 12px; color: #909399">
                                  天
                                </span>
                              </div>
                            </div>
                          </div>
                          <div
                            v-else
                            style="display: flex; align-items: center; white-space: nowrap"
                          >
                            <el-input-number
                              v-model="scope.row.openComparison"
                              :min="1"
                              :max="365"
                              size="mini"
                              @change="validateTimeConfig(scope.row, 'openComparison')"
                              style="width: 100px"
                            ></el-input-number>
                            <span style="margin-left: 5px; font-size: 12px; color: #909399">
                              天
                            </span>
                          </div>
                        </template>
                      </el-table-column>
                      <el-table-column label="公开询价" width="160">
                        <template slot-scope="scope">
                          <!-- 前两个环节显示 - -->
                          <div
                            v-if="
                              scope.row.stage === '采购立项及采购需求文件编制' ||
                              scope.row.stage === '集中采购需求申请接收'
                            "
                            style="text-align: center; color: #909399; font-size: 16px"
                          >
                            -
                          </div>
                          <div
                            v-else-if="scope.row.stage === '采购方案审批'"
                            style="padding: 8px 0"
                          >
                            <!-- 签报审批 -->
                            <div style="margin-bottom: 8px">
                              <div style="font-size: 11px; color: #666; margin-bottom: 4px">
                                签报审批
                              </div>
                              <div style="display: flex; align-items: center">
                                <el-input-number
                                  v-model="scope.row.openInquiryReport"
                                  :min="0"
                                  :max="365"
                                  size="mini"
                                  @change="validateTimeConfig(scope.row, 'openInquiryReport')"
                                  style="width: 100px"
                                ></el-input-number>
                                <span style="margin-left: 5px; font-size: 12px; color: #909399">
                                  天
                                </span>
                              </div>
                            </div>
                            <!-- 上会审批 -->
                            <div>
                              <div style="font-size: 11px; color: #666; margin-bottom: 4px">
                                上会审批
                              </div>
                              <div style="display: flex; align-items: center">
                                <el-input-number
                                  v-model="scope.row.openInquiryMeeting"
                                  :min="0"
                                  :max="365"
                                  size="mini"
                                  @change="validateTimeConfig(scope.row, 'openInquiryMeeting')"
                                  style="width: 100px"
                                ></el-input-number>
                                <span style="margin-left: 5px; font-size: 12px; color: #909399">
                                  天
                                </span>
                              </div>
                            </div>
                          </div>
                          <div
                            v-else
                            style="display: flex; align-items: center; white-space: nowrap"
                          >
                            <el-input-number
                              v-model="scope.row.openInquiry"
                              :min="1"
                              :max="365"
                              size="mini"
                              @change="validateTimeConfig(scope.row, 'openInquiry')"
                              style="width: 100px"
                            ></el-input-number>
                            <span style="margin-left: 5px; font-size: 12px; color: #909399">
                              天
                            </span>
                          </div>
                        </template>
                      </el-table-column>
                      <el-table-column label="邀请招标" width="160">
                        <template slot-scope="scope">
                          <!-- 前两个环节显示 - -->
                          <div
                            v-if="
                              scope.row.stage === '采购立项及采购需求文件编制' ||
                              scope.row.stage === '集中采购需求申请接收'
                            "
                            style="text-align: center; color: #909399; font-size: 16px"
                          >
                            -
                          </div>
                          <div
                            v-else-if="scope.row.stage === '采购方案审批'"
                            style="padding: 8px 0"
                          >
                            <!-- 签报审批 -->
                            <div style="margin-bottom: 8px">
                              <div style="font-size: 11px; color: #666; margin-bottom: 4px">
                                签报审批
                              </div>
                              <div style="display: flex; align-items: center">
                                <el-input-number
                                  v-model="scope.row.invitedTenderReport"
                                  :min="0"
                                  :max="365"
                                  size="mini"
                                  @change="validateTimeConfig(scope.row, 'invitedTenderReport')"
                                  style="width: 100px"
                                ></el-input-number>
                                <span style="margin-left: 5px; font-size: 12px; color: #909399">
                                  天
                                </span>
                              </div>
                            </div>
                            <!-- 上会审批 -->
                            <div>
                              <div style="font-size: 11px; color: #666; margin-bottom: 4px">
                                上会审批
                              </div>
                              <div style="display: flex; align-items: center">
                                <el-input-number
                                  v-model="scope.row.invitedTenderMeeting"
                                  :min="0"
                                  :max="365"
                                  size="mini"
                                  @change="validateTimeConfig(scope.row, 'invitedTenderMeeting')"
                                  style="width: 100px"
                                ></el-input-number>
                                <span style="margin-left: 5px; font-size: 12px; color: #909399">
                                  天
                                </span>
                              </div>
                            </div>
                          </div>
                          <div
                            v-else
                            style="display: flex; align-items: center; white-space: nowrap"
                          >
                            <el-input-number
                              v-model="scope.row.invitedTender"
                              :min="1"
                              :max="365"
                              size="mini"
                              @change="validateTimeConfig(scope.row, 'invitedTender')"
                              style="width: 100px"
                            ></el-input-number>
                            <span style="margin-left: 5px; font-size: 12px; color: #909399">
                              天
                            </span>
                          </div>
                        </template>
                      </el-table-column>
                      <el-table-column label="邀请竞争性磋商" width="160">
                        <template slot-scope="scope">
                          <!-- 前两个环节显示 - -->
                          <div
                            v-if="
                              scope.row.stage === '采购立项及采购需求文件编制' ||
                              scope.row.stage === '集中采购需求申请接收'
                            "
                            style="text-align: center; color: #909399; font-size: 16px"
                          >
                            -
                          </div>
                          <div
                            v-else-if="scope.row.stage === '采购方案审批'"
                            style="padding: 8px 0"
                          >
                            <!-- 签报审批 -->
                            <div style="margin-bottom: 8px">
                              <div style="font-size: 11px; color: #666; margin-bottom: 4px">
                                签报审批
                              </div>
                              <div style="display: flex; align-items: center">
                                <el-input-number
                                  v-model="scope.row.invitedCompetitiveConsultationReport"
                                  :min="0"
                                  :max="365"
                                  size="mini"
                                  @change="validateTimeConfig(scope.row, 'invitedCompetitiveConsultationReport')"
                                  style="width: 100px"
                                ></el-input-number>
                                <span style="margin-left: 3px; font-size: 11px; color: #909399">
                                  天
                                </span>
                              </div>
                            </div>
                            <!-- 上会审批 -->
                            <div>
                              <div style="font-size: 11px; color: #666; margin-bottom: 4px">
                                上会审批
                              </div>
                              <div style="display: flex; align-items: center">
                                <el-input-number
                                  v-model="scope.row.invitedCompetitiveConsultationMeeting"
                                  :min="0"
                                  :max="365"
                                  size="mini"
                                  @change="validateTimeConfig(scope.row, 'invitedCompetitiveConsultationMeeting')"
                                  style="width: 100px"
                                ></el-input-number>
                                <span style="margin-left: 3px; font-size: 11px; color: #909399">
                                  天
                                </span>
                              </div>
                            </div>
                          </div>
                          <div
                            v-else
                            style="display: flex; align-items: center; white-space: nowrap"
                          >
                            <el-input-number
                              v-model="scope.row.invitedCompetitiveConsultation"
                              :min="1"
                              :max="365"
                              size="mini"
                              @change="validateTimeConfig(scope.row, 'invitedCompetitiveConsultation')"
                              style="width: 100px"
                            ></el-input-number>
                            <span style="margin-left: 5px; font-size: 12px; color: #909399">
                              天
                            </span>
                          </div>
                        </template>
                      </el-table-column>
                      <el-table-column label="邀请竞争性谈判" width="160">
                        <template slot-scope="scope">
                          <!-- 前两个环节显示 - -->
                          <div
                            v-if="
                              scope.row.stage === '采购立项及采购需求文件编制' ||
                              scope.row.stage === '集中采购需求申请接收'
                            "
                            style="text-align: center; color: #909399; font-size: 16px"
                          >
                            -
                          </div>
                          <div
                            v-else-if="scope.row.stage === '采购方案审批'"
                            style="padding: 8px 0"
                          >
                            <!-- 签报审批 -->
                            <div style="margin-bottom: 8px">
                              <div style="font-size: 11px; color: #666; margin-bottom: 4px">
                                签报审批
                              </div>
                              <div style="display: flex; align-items: center">
                                <el-input-number
                                  v-model="scope.row.invitedCompetitiveNegotiationReport"
                                  :min="0"
                                  :max="365"
                                  size="mini"
                                  @change="validateTimeConfig(scope.row, 'invitedCompetitiveNegotiationReport')"
                                  style="width: 100px"
                                ></el-input-number>
                                <span style="margin-left: 3px; font-size: 11px; color: #909399">
                                  天
                                </span>
                              </div>
                            </div>
                            <!-- 上会审批 -->
                            <div>
                              <div style="font-size: 11px; color: #666; margin-bottom: 4px">
                                上会审批
                              </div>
                              <div style="display: flex; align-items: center">
                                <el-input-number
                                  v-model="scope.row.invitedCompetitiveNegotiationMeeting"
                                  :min="0"
                                  :max="365"
                                  size="mini"
                                  @change="validateTimeConfig(scope.row, 'invitedCompetitiveNegotiationMeeting')"
                                  style="width: 100px"
                                ></el-input-number>
                                <span style="margin-left: 3px; font-size: 11px; color: #909399">
                                  天
                                </span>
                              </div>
                            </div>
                          </div>
                          <div
                            v-else
                            style="display: flex; align-items: center; white-space: nowrap"
                          >
                            <el-input-number
                              v-model="scope.row.invitedCompetitiveNegotiation"
                              :min="1"
                              :max="365"
                              size="mini"
                              @change="validateTimeConfig(scope.row, 'invitedCompetitiveNegotiation')"
                              style="width: 100px"
                            ></el-input-number>
                            <span style="margin-left: 5px; font-size: 12px; color: #909399">
                              天
                            </span>
                          </div>
                        </template>
                      </el-table-column>
                      <el-table-column label="邀请比选" width="160">
                        <template slot-scope="scope">
                          <!-- 前两个环节显示 - -->
                          <div
                            v-if="
                              scope.row.stage === '采购立项及采购需求文件编制' ||
                              scope.row.stage === '集中采购需求申请接收'
                            "
                            style="text-align: center; color: #909399; font-size: 16px"
                          >
                            -
                          </div>
                          <div
                            v-else-if="scope.row.stage === '采购方案审批'"
                            style="padding: 8px 0"
                          >
                            <!-- 签报审批 -->
                            <div style="margin-bottom: 8px">
                              <div style="font-size: 11px; color: #666; margin-bottom: 4px">
                                签报审批
                              </div>
                              <div style="display: flex; align-items: center">
                                <el-input-number
                                  v-model="scope.row.invitedComparisonReport"
                                  :min="0"
                                  :max="365"
                                  size="mini"
                                  @change="validateTimeConfig(scope.row, 'invitedComparisonReport')"
                                  style="width: 100px"
                                ></el-input-number>
                                <span style="margin-left: 3px; font-size: 11px; color: #909399">
                                  天
                                </span>
                              </div>
                            </div>
                            <!-- 上会审批 -->
                            <div>
                              <div style="font-size: 11px; color: #666; margin-bottom: 4px">
                                上会审批
                              </div>
                              <div style="display: flex; align-items: center">
                                <el-input-number
                                  v-model="scope.row.invitedComparisonMeeting"
                                  :min="0"
                                  :max="365"
                                  size="mini"
                                  @change="validateTimeConfig(scope.row, 'invitedComparisonMeeting')"
                                  style="width: 100px"
                                ></el-input-number>
                                <span style="margin-left: 3px; font-size: 11px; color: #909399">
                                  天
                                </span>
                              </div>
                            </div>
                          </div>
                          <div
                            v-else
                            style="display: flex; align-items: center; white-space: nowrap"
                          >
                            <el-input-number
                              v-model="scope.row.invitedComparison"
                              :min="1"
                              :max="365"
                              size="mini"
                              @change="validateTimeConfig(scope.row, 'invitedComparison')"
                              style="width: 100px"
                            ></el-input-number>
                            <span style="margin-left: 5px; font-size: 12px; color: #909399">
                              天
                            </span>
                          </div>
                        </template>
                      </el-table-column>
                      <el-table-column label="邀请询价" width="160">
                        <template slot-scope="scope">
                          <!-- 前两个环节显示 - -->
                          <div
                            v-if="
                              scope.row.stage === '采购立项及采购需求文件编制' ||
                              scope.row.stage === '集中采购需求申请接收'
                            "
                            style="text-align: center; color: #909399; font-size: 16px"
                          >
                            -
                          </div>
                          <div
                            v-else-if="scope.row.stage === '采购方案审批'"
                            style="padding: 8px 0"
                          >
                            <!-- 签报审批 -->
                            <div style="margin-bottom: 8px">
                              <div style="font-size: 11px; color: #666; margin-bottom: 4px">
                                签报审批
                              </div>
                              <div style="display: flex; align-items: center">
                                <el-input-number
                                  v-model="scope.row.invitedInquiryReport"
                                  :min="0"
                                  :max="365"
                                  size="mini"
                                  @change="validateTimeConfig(scope.row, 'invitedInquiryReport')"
                                  style="width: 100px"
                                ></el-input-number>
                                <span style="margin-left: 3px; font-size: 11px; color: #909399">
                                  天
                                </span>
                              </div>
                            </div>
                            <!-- 上会审批 -->
                            <div>
                              <div style="font-size: 11px; color: #666; margin-bottom: 4px">
                                上会审批
                              </div>
                              <div style="display: flex; align-items: center">
                                <el-input-number
                                  v-model="scope.row.invitedInquiryMeeting"
                                  :min="0"
                                  :max="365"
                                  size="mini"
                                  @change="validateTimeConfig(scope.row, 'invitedInquiryMeeting')"
                                  style="width: 100px"
                                ></el-input-number>
                                <span style="margin-left: 3px; font-size: 11px; color: #909399">
                                  天
                                </span>
                              </div>
                            </div>
                          </div>
                          <div
                            v-else
                            style="display: flex; align-items: center; white-space: nowrap"
                          >
                            <el-input-number
                              v-model="scope.row.invitedInquiry"
                              :min="1"
                              :max="365"
                              size="mini"
                              @change="validateTimeConfig(scope.row, 'invitedInquiry')"
                              style="width: 100px"
                            ></el-input-number>
                            <span style="margin-left: 5px; font-size: 12px; color: #909399">
                              天
                            </span>
                          </div>
                        </template>
                      </el-table-column>
                      <el-table-column label="单一来源" width="160">
                        <template slot-scope="scope">
                          <!-- 前两个环节显示 - -->
                          <div
                            v-if="
                              scope.row.stage === '采购立项及采购需求文件编制' ||
                              scope.row.stage === '集中采购需求申请接收'
                            "
                            style="text-align: center; color: #909399; font-size: 16px"
                          >
                            -
                          </div>
                          <div
                            v-else-if="scope.row.stage === '采购方案审批'"
                            style="padding: 8px 0"
                          >
                            <!-- 签报审批 -->
                            <div style="margin-bottom: 8px">
                              <div style="font-size: 11px; color: #666; margin-bottom: 4px">
                                签报审批
                              </div>
                              <div style="display: flex; align-items: center">
                                <el-input-number
                                  v-model="scope.row.singleSourceReport"
                                  :min="0"
                                  :max="365"
                                  size="mini"
                                  @change="validateTimeConfig(scope.row, 'singleSourceReport')"
                                  style="width: 100px"
                                ></el-input-number>
                                <span style="margin-left: 3px; font-size: 11px; color: #909399">
                                  天
                                </span>
                              </div>
                            </div>
                            <!-- 上会审批 -->
                            <div>
                              <div style="font-size: 11px; color: #666; margin-bottom: 4px">
                                上会审批
                              </div>
                              <div style="display: flex; align-items: center">
                                <el-input-number
                                  v-model="scope.row.singleSourceMeeting"
                                  :min="0"
                                  :max="365"
                                  size="mini"
                                  @change="validateTimeConfig(scope.row, 'singleSourceMeeting')"
                                  style="width: 100px"
                                ></el-input-number>
                                <span style="margin-left: 3px; font-size: 11px; color: #909399">
                                  天
                                </span>
                              </div>
                            </div>
                          </div>
                          <div
                            v-else
                            style="display: flex; align-items: center; white-space: nowrap"
                          >
                            <el-input-number
                              v-model="scope.row.singleSource"
                              :min="1"
                              :max="365"
                              size="mini"
                              @change="validateTimeConfig(scope.row, 'singleSource')"
                              style="width: 100px"
                            ></el-input-number>
                            <span style="margin-left: 5px; font-size: 12px; color: #909399">
                              天
                            </span>
                          </div>
                        </template>
                      </el-table-column>
                    </el-table>
                  </div>
                </div>

                <!-- 配置历史 -->
                <div class="page-section">
                  <div class="section-title">配置历史</div>
                  <div class="table-container">
                    <el-table :data="configHistory" style="width: 100%">
                      <el-table-column
                        prop="updateTime"
                        label="更新时间"
                        width="150"
                      ></el-table-column>
                      <el-table-column prop="operator" label="操作人" width="100"></el-table-column>
                      <el-table-column prop="stage" label="环节名称" width="150"></el-table-column>
                      <el-table-column prop="changeType" label="变更类型" width="100">
                        <template slot-scope="scope">
                          <el-tag :type="scope.row.changeType === '新增' ? 'success' : 'primary'">
                            {{ scope.row.changeType }}
                          </el-tag>
                        </template>
                      </el-table-column>
                      <el-table-column
                        prop="changes"
                        label="变更内容"
                        show-overflow-tooltip
                      ></el-table-column>
                      <el-table-column label="操作" width="120">
                        <template slot-scope="scope">
                          <el-button size="mini" @click="viewConfigHistory(scope.row)">
                            查看
                          </el-button>
                        </template>
                      </el-table-column>
                    </el-table>
                  </div>
                </div>
              </div>

              <!-- 招标代理管理页面 -->
              <div v-show="currentPage === 'agent-management'" class="page-content">
                <div class="page-title">招标代理管理</div>

                <!-- 搜索和操作区域 -->
                <div class="page-section">
                  <el-form :inline="true" :model="agentFilter" class="demo-form-inline">
                    <el-form-item label="代理名称">
                      <el-input
                        v-model="agentFilter.name"
                        placeholder="请输入代理名称"
                        clearable
                      ></el-input>
                    </el-form-item>
                    <el-form-item label="资质等级">
                      <el-select v-model="agentFilter.level" placeholder="请选择资质等级" clearable>
                        <el-option label="全部" value=""></el-option>
                        <el-option label="甲级" value="甲级"></el-option>
                        <el-option label="乙级" value="乙级"></el-option>
                        <el-option label="丙级" value="丙级"></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item label="状态">
                      <el-select v-model="agentFilter.status" placeholder="请选择状态" clearable>
                        <el-option label="全部" value=""></el-option>
                        <el-option label="正常" value="正常"></el-option>
                        <el-option label="暂停" value="暂停"></el-option>
                        <el-option label="注销" value="注销"></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item>
                      <el-button type="primary" @click="handleAgentSearch">查询</el-button>
                      <el-button @click="handleAgentReset">重置</el-button>
                    </el-form-item>
                  </el-form>

                  <div style="margin-top: 20px">
                    <el-button type="primary" @click="addAgent">
                      <i class="el-icon-plus"></i>
                      新增代理
                    </el-button>
                  </div>
                </div>

                <!-- 代理列表 -->
                <div class="page-section">
                  <div class="section-title">招标代理列表</div>
                  <div class="table-container">
                    <el-table
                      :data="agentList"
                      style="width: 100%"
                      @selection-change="handleAgentSelectionChange"
                    >
                      <el-table-column type="selection" width="55"></el-table-column>
                      <el-table-column
                        prop="name"
                        label="代理名称"
                        width="200"
                        show-overflow-tooltip
                      ></el-table-column>
                      <el-table-column prop="code" label="代理编号" width="120"></el-table-column>
                      <el-table-column prop="level" label="资质等级" width="100">
                        <template slot-scope="scope">
                          <el-tag :type="getAgentLevelType(scope.row.level)">
                            {{ scope.row.level }}
                          </el-tag>
                        </template>
                      </el-table-column>
                      <el-table-column
                        prop="contactPerson"
                        label="联系人"
                        width="100"
                      ></el-table-column>
                      <el-table-column prop="phone" label="联系电话" width="130"></el-table-column>
                      <el-table-column
                        prop="email"
                        label="邮箱"
                        width="180"
                        show-overflow-tooltip
                      ></el-table-column>
                      <el-table-column
                        prop="address"
                        label="地址"
                        width="200"
                        show-overflow-tooltip
                      ></el-table-column>
                      <el-table-column prop="status" label="状态" width="100">
                        <template slot-scope="scope">
                          <el-tag :type="getAgentStatusType(scope.row.status)">
                            {{ scope.row.status }}
                          </el-tag>
                        </template>
                      </el-table-column>
                      <el-table-column
                        prop="projectCount"
                        label="承接项目数"
                        width="100"
                      ></el-table-column>
                      <el-table-column prop="winRate" label="中标概率" width="100">
                        <template slot-scope="scope">
                          <span>{{ scope.row.winRate }}%</span>
                        </template>
                      </el-table-column>
                      <el-table-column label="操作" width="320" fixed="right">
                        <template slot-scope="scope">
                          <el-button size="mini" @click="viewAgent(scope.row)">查看</el-button>
                          <el-button size="mini" type="primary" @click="editAgent(scope.row)">
                            编辑
                          </el-button>
                          <el-button
                            size="mini"
                            type="warning"
                            @click="toggleAgentStatus(scope.row)"
                          >
                            {{ scope.row.status === '正常' ? '暂停' : '启用' }}
                          </el-button>
                          <el-button size="mini" type="danger" @click="deleteAgent(scope.row)">
                            删除
                          </el-button>
                        </template>
                      </el-table-column>
                    </el-table>
                  </div>

                  <div style="margin-top: 20px; text-align: right">
                    <el-pagination
                      @size-change="handleAgentSizeChange"
                      @current-change="handleAgentCurrentChange"
                      :current-page="agentPagination.currentPage"
                      :page-sizes="[10, 20, 50, 100]"
                      :page-size="agentPagination.pageSize"
                      layout="total, sizes, prev, pager, next, jumper"
                      :total="agentPagination.total"
                    ></el-pagination>
                  </div>
                </div>

                <!-- 暂停代理公司对话框 -->
                <el-dialog
                  title="暂停代理公司"
                  :visible.sync="pauseAgentDialog.visible"
                  width="500px"
                >
                  <el-form :model="pauseAgentDialog.form" label-width="100px">
                    <el-form-item label="开始时间" required>
                      <el-date-picker
                        v-model="pauseAgentDialog.form.startTime"
                        type="date"
                        placeholder="请选择开始时间"
                        value-format="yyyy-MM-dd"
                        style="width: 100%"
                      ></el-date-picker>
                    </el-form-item>
                    <el-form-item label="结束时间" required>
                      <el-date-picker
                        v-model="pauseAgentDialog.form.endTime"
                        type="date"
                        placeholder="请选择结束时间"
                        value-format="yyyy-MM-dd"
                        style="width: 100%"
                      ></el-date-picker>
                    </el-form-item>
                    <el-form-item label="暂停原因" required>
                      <el-input
                        type="textarea"
                        v-model="pauseAgentDialog.form.reason"
                        :rows="4"
                        placeholder="请输入暂停原因"
                      ></el-input>
                    </el-form-item>
                  </el-form>
                  <div slot="footer" class="dialog-footer">
                    <el-button @click="pauseAgentDialog.visible = false">取消</el-button>
                    <el-button type="primary" @click="confirmPauseAgent">确定</el-button>
                  </div>
                </el-dialog>
              </div>

              <!-- 用户权限管理页面 -->
              <div v-show="currentPage === 'user-management'" class="page-content">
                <div class="page-title">用户权限管理</div>

                <!-- 搜索和操作区域 -->
                <div class="page-section">
                  <el-form :inline="true" :model="userFilter" class="demo-form-inline">
                    <el-form-item label="用户名">
                      <el-input
                        v-model="userFilter.username"
                        placeholder="请输入用户名"
                        clearable
                      ></el-input>
                    </el-form-item>
                    <el-form-item label="姓名">
                      <el-input
                        v-model="userFilter.realName"
                        placeholder="请输入姓名"
                        clearable
                      ></el-input>
                    </el-form-item>
                    <el-form-item label="角色">
                      <el-select v-model="userFilter.role" placeholder="请选择角色" clearable>
                        <el-option label="全部" value=""></el-option>
                        <el-option label="系统管理员" value="admin"></el-option>
                        <el-option label="采购经理" value="manager"></el-option>
                        <el-option label="采购员" value="buyer"></el-option>
                        <el-option label="财务人员" value="finance"></el-option>
                        <el-option label="普通用户" value="user"></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item label="状态">
                      <el-select v-model="userFilter.status" placeholder="请选择状态" clearable>
                        <el-option label="全部" value=""></el-option>
                        <el-option label="正常" value="正常"></el-option>
                        <el-option label="禁用" value="禁用"></el-option>
                        <el-option label="锁定" value="锁定"></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item>
                      <el-button type="primary" @click="handleUserSearch">查询</el-button>
                      <el-button @click="handleUserReset">重置</el-button>
                    </el-form-item>
                  </el-form>

                  <div style="margin-top: 20px">
                    <el-button type="primary" @click="addUser">
                      <i class="el-icon-plus"></i>
                      新增用户
                    </el-button>
                    <el-button type="success" @click="batchImportUsers">
                      <i class="el-icon-upload"></i>
                      批量导入
                    </el-button>
                    <el-button type="warning" @click="exportUsers">
                      <i class="el-icon-download"></i>
                      导出数据
                    </el-button>
                    <el-button
                      type="danger"
                      @click="batchDeleteUsers"
                      :disabled="selectedUsers.length === 0"
                    >
                      <i class="el-icon-delete"></i>
                      批量删除
                    </el-button>
                  </div>
                </div>

                <!-- 用户列表 -->
                <div class="page-section">
                  <div class="section-title">用户列表</div>
                  <div class="table-container">
                    <el-table
                      :data="userList"
                      style="width: 100%"
                      @selection-change="handleUserSelectionChange"
                    >
                      <el-table-column type="selection" width="55"></el-table-column>
                      <el-table-column prop="username" label="用户名" width="120"></el-table-column>
                      <el-table-column prop="realName" label="姓名" width="100"></el-table-column>
                      <el-table-column
                        prop="email"
                        label="邮箱"
                        width="180"
                        show-overflow-tooltip
                      ></el-table-column>
                      <el-table-column prop="phone" label="手机号" width="130"></el-table-column>
                      <el-table-column prop="department" label="部门" width="120"></el-table-column>
                      <el-table-column prop="role" label="角色" width="120">
                        <template slot-scope="scope">
                          <el-tag :type="getRoleType(scope.row.role)">
                            {{ getRoleName(scope.row.role) }}
                          </el-tag>
                        </template>
                      </el-table-column>
                      <el-table-column prop="status" label="状态" width="100">
                        <template slot-scope="scope">
                          <el-tag :type="getUserStatusType(scope.row.status)">
                            {{ scope.row.status }}
                          </el-tag>
                        </template>
                      </el-table-column>
                      <el-table-column
                        prop="lastLoginTime"
                        label="最后登录"
                        width="150"
                      ></el-table-column>
                      <el-table-column
                        prop="createTime"
                        label="创建时间"
                        width="150"
                      ></el-table-column>
                      <el-table-column label="操作" width="400" fixed="right">
                        <template slot-scope="scope">
                          <el-button size="mini" @click="viewUser(scope.row)">查看</el-button>
                          <el-button size="mini" type="primary" @click="editUser(scope.row)">
                            编辑
                          </el-button>
                          <el-button size="mini" type="warning" @click="resetPassword(scope.row)">
                            重置密码
                          </el-button>
                          <el-button size="mini" type="info" @click="managePermissions(scope.row)">
                            权限
                          </el-button>
                          <el-button size="mini" type="danger" @click="deleteUser(scope.row)">
                            删除
                          </el-button>
                        </template>
                      </el-table-column>
                    </el-table>
                  </div>

                  <div style="margin-top: 20px; text-align: right">
                    <el-pagination
                      @size-change="handleUserSizeChange"
                      @current-change="handleUserCurrentChange"
                      :current-page="userPagination.currentPage"
                      :page-sizes="[10, 20, 50, 100]"
                      :page-size="userPagination.pageSize"
                      layout="total, sizes, prev, pager, next, jumper"
                      :total="userPagination.total"
                    ></el-pagination>
                  </div>
                </div>
              </div>

              <!-- 其他页面内容将在后续添加 -->
              <div
                v-show="!['project-list', 'project-create', 'project-detail', 'summary-stats', 'detail-stats', 'warning-stats', 'time-config', 'agent-management', 'user-management'].includes(currentPage)"
                class="page-content"
              >
                <div class="page-title">{{ getPageTitle() }}</div>
                <div style="text-align: center; padding: 50px; color: #909399">
                  <i class="el-icon-info" style="font-size: 48px; margin-bottom: 20px"></i>
                  <p>页面开发中...</p>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <script>
      new Vue({
        el: '#app',
        data() {
          return {
            currentPage: 'project-list',
            breadcrumb: {
              main: '项目管理',
              sub: '项目列表',
            },
            searchForm: {
              keyword: '',
              status: '',
              type: '',
            },
            projectList: [
              {
                id: 1,
                name: '江苏省分行办公设备采购项目',
                type: '公开招标',
                status: '进行中',
                progress: 65,
                department: '采购部',
                manager: '张经理',
                startDate: '2024-01-15',
                endDate: '2024-03-15',
                children: [
                  {
                    id: 11,
                    name: '江苏省分行办公设备采购项目标包1',
                    type: '公开招标',
                    status: '已完成',
                    progress: 100,
                    department: '采购部',
                    manager: '李经理',
                    startDate: '2024-01-15',
                    endDate: '2024-02-15',
                  },
                  {
                    id: 12,
                    name: '江苏省分行办公设备采购项目标包2',
                    type: '邀请招标',
                    status: '进行中',
                    progress: 30,
                    department: '采购部',
                    manager: '王经理',
                    startDate: '2024-02-01',
                    endDate: '2024-03-01',
                  },
                  {
                    id: 13,
                    name: '江苏省分行办公设备采购项目标包3',
                    type: '竞争性谈判',
                    status: '进行中',
                    progress: 65,
                    department: '采购部',
                    manager: '赵经理',
                    startDate: '2024-02-15',
                    endDate: '2024-03-15',
                  },
                  {
                    id: 14,
                    name: '江苏省分行办公设备采购项目标包4',
                    type: '公开招标',
                    status: '进行中',
                    progress: 45,
                    department: '采购部',
                    manager: '钱经理',
                    startDate: '2024-03-01',
                    endDate: '2024-04-01',
                  },
                  {
                    id: 15,
                    name: '江苏省分行办公设备采购项目标包5',
                    type: '邀请招标',
                    status: '进行中',
                    progress: 20,
                    department: '采购部',
                    manager: '孙经理',
                    startDate: '2024-03-15',
                    endDate: '2024-04-15',
                  },
                  {
                    id: 16,
                    name: '江苏省分行办公设备采购项目标包6',
                    type: '竞争性谈判',
                    status: '进行中',
                    progress: 10,
                    department: '采购部',
                    manager: '周经理',
                    startDate: '2024-04-01',
                    endDate: '2024-05-01',
                  },
                  {
                    id: 17,
                    name: '江苏省分行办公设备采购项目标包7',
                    type: '公开招标',
                    status: '进行中',
                    progress: 5,
                    department: '采购部',
                    manager: '吴经理',
                    startDate: '2024-04-15',
                    endDate: '2024-05-15',
                  },
                  {
                    id: 18,
                    name: '江苏省分行办公设备采购项目标包8',
                    type: '邀请招标',
                    status: '进行中',
                    progress: 0,
                    department: '采购部',
                    manager: '郑经理',
                    startDate: '2024-05-01',
                    endDate: '2024-06-01',
                  },
                  {
                    id: 19,
                    name: '江苏省分行办公设备采购项目标包9',
                    type: '竞争性谈判',
                    status: '进行中',
                    progress: 0,
                    department: '采购部',
                    manager: '王经理',
                    startDate: '2024-05-15',
                    endDate: '2024-06-15',
                  },
                  {
                    id: 20,
                    name: '江苏省分行办公设备采购项目标包10',
                    type: '公开招标',
                    status: '进行中',
                    progress: 0,
                    department: '采购部',
                    manager: '李经理',
                    startDate: '2024-06-01',
                    endDate: '2024-07-01',
                  },
                ],
              },
              {
                id: 2,
                name: '江苏省分行网络设备升级项目',
                type: '竞争性谈判',
                status: '已完成',
                progress: 100,
                department: '技术部',
                manager: '赵经理',
                startDate: '2023-12-01',
                endDate: '2024-01-31',
              },
              {
                id: 3,
                name: '江苏省分行安防系统采购项目',
                type: '公开招标',
                status: '已暂停',
                progress: 20,
                department: '安全部',
                manager: '钱经理',
                startDate: '2024-02-01',
                endDate: '2024-04-01',
              },
            ],
            pagination: {
              currentPage: 1,
              pageSize: 10,
              total: 3,
            },
            createStep: 0,
            projectForm: {
              name: '',
              code: '',
              type: '',
              budget: '',
              department: '',
              description: '',
            },
            // 第二步：选取项目责任组
            responsibilityForm: {
              responsibilityGroup: '责任组A',
              modifyReason: '',
            },
            // 第三步：选择指定代理公司或随机分配
            agentForm: {
              agentCompany: '江苏招标代理有限公司',
              modifyReason: '',
            },
            // 控制修改原因显示
            showResponsibilityModifyReason: false,
            showAgentModifyReason: false,
            // 默认分配值
            defaultResponsibilityGroup: '责任组A',
            defaultResponsiblePerson: '张三',
            defaultAgentCompany: '江苏招标代理有限公司',
            // 分配结果确认数据
            allocatedManager: {
              name: 'A项目组、E项目组',
              department: '采购部',
              phone: '138****0002',
            },
            selectedAgents: ['agent1'],
            showModifyReason: false,
            modifyReason: '',
            agentOptions: [
              { id: 'agent1', name: '南京招标咨询有限公司', level: '甲级' },
              { id: 'agent2', name: '南京采购咨询公司', level: '乙级' },
              { id: 'agent3', name: '苏州招标服务公司', level: '丙级' },
            ],
            projectRules: {
              name: [{ required: true, message: '请输入采购项目名称', trigger: 'blur' }],
              code: [{ required: true, message: '请输入采购项目编号', trigger: 'blur' }],
              type: [{ required: true, message: '请选择采购方式', trigger: 'change' }],
              budget: [{ required: true, message: '请输入采购估算金额', trigger: 'blur' }],
              department: [{ required: true, message: '请选择采购需求部门', trigger: 'change' }],
            },
            // 第二步验证规则
            responsibilityRules: {
              responsibilityGroup: [
                { required: true, message: '请选择项目责任组', trigger: 'change' },
              ],
            },
            // 第三步验证规则
            agentRules: {
              agentCompany: [{ required: false, message: '请选择招标代理公司', trigger: 'change' }],
            },
            subProjects: [
              {
                name: '江苏省分行办公设备采购项目标包1',
                type: '公开招标',
                budget: '200',
                manager: '李经理',
                department: '采购部',
                startDate: '2024-01-15',
                endDate: '2024-02-15',
                status: '已完成',
                progress: 100,
              },
              {
                name: '江苏省分行办公设备采购项目标包2',
                type: '邀请招标',
                budget: '150',
                manager: '王经理',
                department: '采购部',
                startDate: '2024-02-01',
                endDate: '2024-03-01',
                status: '进行中',
                progress: 30,
              },
              {
                name: '江苏省分行办公设备采购项目标包3',
                type: '竞争性谈判',
                budget: '180',
                manager: '赵经理',
                department: '采购部',
                startDate: '2024-02-15',
                endDate: '2024-03-15',
                status: '进行中',
                progress: 65,
              },
              {
                name: '江苏省分行办公设备采购项目标包4',
                type: '公开招标',
                budget: '220',
                manager: '钱经理',
                department: '采购部',
                startDate: '2024-03-01',
                endDate: '2024-04-01',
                status: '进行中',
                progress: 45,
              },
              {
                name: '江苏省分行办公设备采购项目标包5',
                type: '邀请招标',
                budget: '160',
                manager: '孙经理',
                department: '采购部',
                startDate: '2024-03-15',
                endDate: '2024-04-15',
                status: '进行中',
                progress: 20,
              },
              {
                name: '江苏省分行办公设备采购项目标包6',
                type: '竞争性谈判',
                budget: '190',
                manager: '周经理',
                department: '采购部',
                startDate: '2024-04-01',
                endDate: '2024-05-01',
                status: '进行中',
                progress: 10,
              },
              {
                name: '江苏省分行办公设备采购项目标包7',
                type: '公开招标',
                budget: '210',
                manager: '吴经理',
                department: '采购部',
                startDate: '2024-04-15',
                endDate: '2024-05-15',
                status: '进行中',
                progress: 5,
              },
              {
                name: '江苏省分行办公设备采购项目标包8',
                type: '邀请招标',
                budget: '170',
                manager: '郑经理',
                department: '采购部',
                startDate: '2024-05-01',
                endDate: '2024-06-01',
                status: '进行中',
                progress: 0,
              },
              {
                name: '江苏省分行办公设备采购项目标包9',
                type: '竞争性谈判',
                budget: '200',
                manager: '王经理',
                department: '采购部',
                startDate: '2024-05-15',
                endDate: '2024-06-15',
                status: '进行中',
                progress: 0,
              },
              {
                name: '江苏省分行办公设备采购项目标包10',
                type: '公开招标',
                budget: '180',
                manager: '李经理',
                department: '采购部',
                startDate: '2024-06-01',
                endDate: '2024-07-01',
                status: '进行中',
                progress: 0,
              },
            ],
            departmentStats: [
              {
                department: '采购部',
                totalProjects: 8,
                ongoingProjects: 5,
                completedProjects: 2,
                delayedProjects: 1,
              },
              {
                department: '技术部',
                totalProjects: 4,
                ongoingProjects: 2,
                completedProjects: 2,
                delayedProjects: 0,
              },
              {
                department: '财务部',
                totalProjects: 2,
                ongoingProjects: 1,
                completedProjects: 1,
                delayedProjects: 0,
              },
              {
                department: '安全部',
                totalProjects: 1,
                ongoingProjects: 0,
                completedProjects: 0,
                delayedProjects: 1,
              },
            ],
            // 责任组统计数据
            responsibleGroupStats: [
              {
                responsibleGroup: '采购一组',
                projectCount: 12,
                procurementAmount: 1500,
                averageDuration: 45,
              },
              {
                responsibleGroup: '采购二组',
                projectCount: 8,
                procurementAmount: 1200,
                averageDuration: 38,
              },
              {
                responsibleGroup: '技术采购组',
                projectCount: 7,
                procurementAmount: 900,
                averageDuration: 40,
              },
            ],
            // 责任人统计数据
            responsiblePersonStats: [
              {
                responsiblePerson: '张三',
                projectCount: 6,
                procurementAmount: 800,
                averageDuration: 42,
              },
              {
                responsiblePerson: '李四',
                projectCount: 10,
                procurementAmount: 1100,
                averageDuration: 35,
              },
              {
                responsiblePerson: '王五',
                projectCount: 4,
                procurementAmount: 600,
                averageDuration: 50,
              },
              {
                responsiblePerson: '赵六',
                projectCount: 9,
                procurementAmount: 1300,
                averageDuration: 33,
              },
              {
                responsiblePerson: '孙七',
                projectCount: 5,
                procurementAmount: 700,
                averageDuration: 48,
              },
            ],
            // 采购方式统计数据
            methodStats: [
              {
                method: '公开招标',
                projectCount: 15,
                averageAmount: 1200,
                averageDuration: 45,
              },
              {
                method: '邀请招标',
                projectCount: 8,
                averageAmount: 800,
                averageDuration: 38,
              },
              {
                method: '竞争性谈判',
                projectCount: 12,
                averageAmount: 600,
                averageDuration: 35,
              },
              {
                method: '单一来源',
                projectCount: 5,
                averageAmount: 300,
                averageDuration: 25,
              },
              {
                method: '询价采购',
                projectCount: 6,
                averageAmount: 150,
                averageDuration: 20,
              },
              {
                method: '框架协议',
                projectCount: 3,
                averageAmount: 2000,
                averageDuration: 60,
              },
            ],
            // 汇总页三张二维表（与移动端统计页面一致的结构）
            summaryGroupPersonTable: [
              {
                name: '项目1组',
                assigned: '',
                completed: '',
                todo: '',
                planPending: '',
                execPending: '',
              },
              {
                name: '田明嘉',
                assigned: '',
                completed: '',
                todo: '',
                planPending: '',
                execPending: '',
              },
              {
                name: '项目2组',
                assigned: '',
                completed: '',
                todo: '',
                planPending: '',
                execPending: '',
              },
              {
                name: '陈尚龙',
                assigned: '',
                completed: '',
                todo: '',
                planPending: '',
                execPending: '',
              },
              {
                name: '朱曼',
                assigned: '',
                completed: '',
                todo: '',
                planPending: '',
                execPending: '',
              },
              {
                name: '邢璐',
                assigned: '',
                completed: '',
                todo: '',
                planPending: '',
                execPending: '',
              },
            ],
            summaryAgentTable: [
              { org: '代理公司1', assigned: '', completed: '', todo: '' },
              { org: '代理公司2', assigned: '', completed: '', todo: '' },
              { org: '代理公司3', assigned: '', completed: '', todo: '' },
              { org: '代理公司4', assigned: '', completed: '', todo: '' },
            ],
            summaryMethodTable: [
              {
                method: '公开招标',
                count: '',
                amount: '',
                avgDays: '',
                failCount: '',
                failRate: '',
                saveAmount: '',
                saveRate: '',
                openBid: '',
                openRate: '',
              },
              {
                method: '公开竞争性磋商',
                count: '',
                amount: '',
                avgDays: '',
                failCount: '',
                failRate: '',
                saveAmount: '',
                saveRate: '',
                openBid: '',
                openRate: '',
              },
              {
                method: '邀请招标',
                count: '',
                amount: '',
                avgDays: '',
                failCount: '',
                failRate: '',
                saveAmount: '',
                saveRate: '',
                openBid: '',
                openRate: '',
              },
              {
                method: '邀请竞争性磋商',
                count: '',
                amount: '',
                avgDays: '',
                failCount: '',
                failRate: '',
                saveAmount: '',
                saveRate: '',
                openBid: '',
                openRate: '',
              },
              {
                method: '单一来源',
                count: '',
                amount: '',
                avgDays: '',
                failCount: '',
                failRate: '',
                saveAmount: '',
                saveRate: '',
                openBid: '',
                openRate: '',
              },
              {
                method: '询价',
                count: '',
                amount: '',
                avgDays: '',
                failCount: '',
                failRate: '',
                saveAmount: '',
                saveRate: '',
                openBid: '',
                openRate: '',
              },
              {
                method: '框架协议',
                count: '',
                amount: '',
                avgDays: '',
                failCount: '',
                failRate: '',
                saveAmount: '',
                saveRate: '',
                openBid: '',
                openRate: '',
              },
              {
                method: '直接采购',
                count: '',
                amount: '',
                avgDays: '',
                failCount: '',
                failRate: '',
                saveAmount: '',
                saveRate: '',
                openBid: '',
                openRate: '',
              },
              {
                method: '竞争性谈判',
                count: '',
                amount: '',
                avgDays: '',
                failCount: '',
                failRate: '',
                saveAmount: '',
                saveRate: '',
                openBid: '',
                openRate: '',
              },
              {
                method: '竞争性磋商',
                count: '',
                amount: '',
                avgDays: '',
                failCount: '',
                failRate: '',
                saveAmount: '',
                saveRate: '',
                openBid: '',
                openRate: '',
              },
              {
                method: '其他',
                count: '',
                amount: '',
                avgDays: '',
                failCount: '',
                failRate: '',
                saveAmount: '',
                saveRate: '',
                openBid: '',
                openRate: '',
              },
              {
                method: '合计',
                count: '',
                amount: '',
                avgDays: '',
                failCount: '',
                failRate: '',
                saveAmount: '',
                saveRate: '',
                openBid: '',
                openRate: '',
              },
            ],
            // 明细统计页面数据
            detailStatsFilter: {
              projectName: '',
              department: '',
              type: '',
              status: '',
            },
            // 环节列定义 - 包含所有15个采购环节
            stageColumns: [
              { key: 'stage1', name: '采购立项', width: 120 },
              { key: 'stage2', name: '需求申请', width: 120 },
              { key: 'stage3', name: '方案制订', width: 120 },
              { key: 'stage4', name: '方案审批', width: 120 },
              { key: 'stage5', name: '公告发布', width: 120 },
              { key: 'stage6', name: '项目实施', width: 120 },
              { key: 'stage7', name: '结果撰写', width: 120 },
              { key: 'stage8', name: '结果审批', width: 120 },
              { key: 'stage9', name: '结果公示', width: 120 },
              { key: 'stage10', name: '合同拟定', width: 120 },
              { key: 'stage11', name: '合同会签', width: 120 },
              { key: 'stage12', name: '合同法律审查', width: 120 },
              { key: 'stage13', name: '合同文本审定及用印', width: 120 },
              { key: 'stage14', name: '合同寄收', width: 120 },
              { key: 'stage15', name: '合同归档', width: 120 },
            ],
            detailStatsList: [
              {
                id: 1,
                projectName: '江苏省分行办公设备采购项目',
                projectCode: 'CG2024001',
                type: '公开招标',
                manager: '张经理',
                status: '进行中',
                savingRate: 15.5,
                savingAmount: 25.8,
                stages: {
                  stage1: {
                    status: '已完成',
                    startTime: '2024-01-15',
                    endTime: '2024-01-17',
                    actualDuration: 3,
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage2: {
                    status: '已完成',
                    startTime: '2024-01-18',
                    endTime: '2024-01-19',
                    actualDuration: 2,
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage3: {
                    status: '已完成',
                    startTime: '2024-01-20',
                    endTime: '2024-01-23',
                    actualDuration: 4,
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage4: {
                    status: '已完成',
                    startTime: '2024-01-24',
                    endTime: '2024-01-25',
                    actualDuration: 2,
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage5: {
                    status: '已完成',
                    startTime: '2024-01-26',
                    endTime: '2024-01-26',
                    actualDuration: 1,
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage6: {
                    status: '进行中',
                    startTime: '2024-01-27',
                    endTime: '-',
                    actualDuration: '-',
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage7: {
                    status: '未开始',
                    startTime: '-',
                    endTime: '-',
                    actualDuration: '-',
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage8: {
                    status: '未开始',
                    startTime: '-',
                    endTime: '-',
                    actualDuration: '-',
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage9: {
                    status: '未开始',
                    startTime: '-',
                    endTime: '-',
                    actualDuration: '-',
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage10: {
                    status: '未开始',
                    startTime: '-',
                    endTime: '-',
                    actualDuration: '-',
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage11: {
                    status: '未开始',
                    startTime: '-',
                    endTime: '-',
                    actualDuration: '-',
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage12: {
                    status: '未开始',
                    startTime: '-',
                    endTime: '-',
                    actualDuration: '-',
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage13: {
                    status: '未开始',
                    startTime: '-',
                    endTime: '-',
                    actualDuration: '-',
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage14: {
                    status: '未开始',
                    startTime: '-',
                    endTime: '-',
                    actualDuration: '-',
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage15: {
                    status: '未开始',
                    startTime: '-',
                    endTime: '-',
                    actualDuration: '-',
                    isOverdue: false,
                    overdueDays: 0,
                  },
                },
                children: [
                  {
                    id: 11,
                    projectName: '江苏省分行办公设备采购项目标包1',
                    projectCode: 'CG2024001-01',
                    type: '公开招标',
                    manager: '李经理',
                    status: '已完成',
                    savingRate: 12.3,
                    savingAmount: 15.6,
                    stages: {
                      stage1: {
                        status: '已完成',
                        startTime: '2024-01-15',
                        endTime: '2024-01-16',
                        actualDuration: 2,
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage2: {
                        status: '已完成',
                        startTime: '2024-01-17',
                        endTime: '2024-01-17',
                        actualDuration: 1,
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage3: {
                        status: '已完成',
                        startTime: '2024-01-18',
                        endTime: '2024-01-20',
                        actualDuration: 3,
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage4: {
                        status: '已完成',
                        startTime: '2024-01-21',
                        endTime: '2024-01-21',
                        actualDuration: 1,
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage5: {
                        status: '已完成',
                        startTime: '2024-01-22',
                        endTime: '2024-01-22',
                        actualDuration: 1,
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage6: {
                        status: '进行中',
                        startTime: '2024-01-23',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage7: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage8: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage9: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage10: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage11: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage12: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage13: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage14: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage15: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                    },
                  },
                  {
                    id: 12,
                    projectName: '江苏省分行办公设备采购项目标包2',
                    projectCode: 'CG2024001-02',
                    type: '邀请招标',
                    manager: '王经理',
                    status: '进行中',
                    savingRate: 10.5,
                    savingAmount: 10.2,
                    stages: {
                      stage1: {
                        status: '已完成',
                        startTime: '2024-01-20',
                        endTime: '2024-01-21',
                        actualDuration: 2,
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage2: {
                        status: '已完成',
                        startTime: '2024-01-22',
                        endTime: '2024-01-22',
                        actualDuration: 1,
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage3: {
                        status: '已完成',
                        startTime: '2024-01-23',
                        endTime: '2024-01-25',
                        actualDuration: 3,
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage4: {
                        status: '已完成',
                        startTime: '2024-01-26',
                        endTime: '2024-01-26',
                        actualDuration: 1,
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage5: {
                        status: '已完成',
                        startTime: '2024-01-27',
                        endTime: '2024-01-27',
                        actualDuration: 1,
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage6: {
                        status: '进行中',
                        startTime: '2024-01-28',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage7: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage8: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage9: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage10: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage11: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage12: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage13: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage14: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage15: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                    },
                  },
                ],
              },
              {
                id: 2,
                projectName: '江苏省分行网络设备升级项目',
                projectCode: 'CG2024002',
                type: '竞争性谈判',
                manager: '赵经理',
                status: '已完成',
                stages: {
                  stage1: {
                    status: '已完成',
                    startTime: '2023-12-01',
                    endTime: '2023-12-03',
                    actualDuration: 3,
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage2: {
                    status: '已完成',
                    startTime: '2023-12-04',
                    endTime: '2023-12-04',
                    actualDuration: 1,
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage3: {
                    status: '已完成',
                    startTime: '2023-12-05',
                    endTime: '2023-12-08',
                    actualDuration: 4,
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage4: {
                    status: '已完成',
                    startTime: '2023-12-09',
                    endTime: '2023-12-10',
                    actualDuration: 2,
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage5: {
                    status: '已完成',
                    startTime: '2023-12-11',
                    endTime: '2023-12-11',
                    actualDuration: 1,
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage6: {
                    status: '已完成',
                    startTime: '2023-12-12',
                    endTime: '2023-12-20',
                    actualDuration: 9,
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage7: {
                    status: '已完成',
                    startTime: '2023-12-21',
                    endTime: '2023-12-22',
                    actualDuration: 2,
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage8: {
                    status: '已完成',
                    startTime: '2023-12-23',
                    endTime: '2023-12-24',
                    actualDuration: 2,
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage9: {
                    status: '已完成',
                    startTime: '2023-12-25',
                    endTime: '2023-12-25',
                    actualDuration: 1,
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage10: {
                    status: '已完成',
                    startTime: '2023-12-26',
                    endTime: '2023-12-28',
                    actualDuration: 3,
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage11: {
                    status: '已完成',
                    startTime: '2023-12-29',
                    endTime: '2023-12-30',
                    actualDuration: 2,
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage12: {
                    status: '已完成',
                    startTime: '2023-12-31',
                    endTime: '2024-01-02',
                    actualDuration: 3,
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage13: {
                    status: '已完成',
                    startTime: '2024-01-03',
                    endTime: '2024-01-04',
                    actualDuration: 2,
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage14: {
                    status: '已完成',
                    startTime: '2024-01-05',
                    endTime: '2024-01-06',
                    actualDuration: 2,
                    isOverdue: false,
                    overdueDays: 0,
                  },
                },
              },
              {
                id: 3,
                projectName: '江苏省分行安防系统采购项目',
                projectCode: 'CG2024003',
                type: '公开招标',
                manager: '钱经理',
                status: '已暂停',
                savingRate: 8.2,
                savingAmount: 12.5,
                stages: {
                  stage1: {
                    status: '已完成',
                    startTime: '2024-02-01',
                    endTime: '2024-02-03',
                    actualDuration: 3,
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage2: {
                    status: '已完成',
                    startTime: '2024-02-04',
                    endTime: '2024-02-04',
                    actualDuration: 1,
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage3: {
                    status: '已完成',
                    startTime: '2024-02-05',
                    endTime: '2024-02-08',
                    actualDuration: 4,
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage4: {
                    status: '已完成',
                    startTime: '2024-02-09',
                    endTime: '2024-02-10',
                    actualDuration: 2,
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage5: {
                    status: '已完成',
                    startTime: '2024-02-11',
                    endTime: '2024-02-11',
                    actualDuration: 1,
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage6: {
                    status: '超时',
                    startTime: '2024-02-12',
                    endTime: '-',
                    actualDuration: '-',
                    isOverdue: true,
                    overdueDays: 15,
                  },
                  stage7: {
                    status: '未开始',
                    startTime: '-',
                    endTime: '-',
                    actualDuration: '-',
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage8: {
                    status: '未开始',
                    startTime: '-',
                    endTime: '-',
                    actualDuration: '-',
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage9: {
                    status: '未开始',
                    startTime: '-',
                    endTime: '-',
                    actualDuration: '-',
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage10: {
                    status: '未开始',
                    startTime: '-',
                    endTime: '-',
                    actualDuration: '-',
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage11: {
                    status: '未开始',
                    startTime: '-',
                    endTime: '-',
                    actualDuration: '-',
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage12: {
                    status: '未开始',
                    startTime: '-',
                    endTime: '-',
                    actualDuration: '-',
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage13: {
                    status: '未开始',
                    startTime: '-',
                    endTime: '-',
                    actualDuration: '-',
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage14: {
                    status: '未开始',
                    startTime: '-',
                    endTime: '-',
                    actualDuration: '-',
                    isOverdue: false,
                    overdueDays: 0,
                  },
                  stage15: {
                    status: '未开始',
                    startTime: '-',
                    endTime: '-',
                    actualDuration: '-',
                    isOverdue: false,
                    overdueDays: 0,
                  },
                },
                children: [
                  {
                    id: 31,
                    projectName: '监控设备采购',
                    projectCode: 'CG2024003-01',
                    type: '公开招标',
                    manager: '钱经理',
                    status: '已暂停',
                    stages: {
                      stage1: {
                        status: '已完成',
                        startTime: '2024-02-01',
                        endTime: '2024-02-02',
                        actualDuration: 2,
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage2: {
                        status: '已完成',
                        startTime: '2024-02-03',
                        endTime: '2024-02-03',
                        actualDuration: 1,
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage3: {
                        status: '已完成',
                        startTime: '2024-02-04',
                        endTime: '2024-02-06',
                        actualDuration: 3,
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage4: {
                        status: '已完成',
                        startTime: '2024-02-07',
                        endTime: '2024-02-07',
                        actualDuration: 1,
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage5: {
                        status: '已完成',
                        startTime: '2024-02-08',
                        endTime: '2024-02-08',
                        actualDuration: 1,
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage6: {
                        status: '超时',
                        startTime: '2024-02-09',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: true,
                        overdueDays: 15,
                      },
                      stage7: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage8: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage9: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage10: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage11: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage12: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage13: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage14: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                      stage15: {
                        status: '未开始',
                        startTime: '-',
                        endTime: '-',
                        actualDuration: '-',
                        isOverdue: false,
                        overdueDays: 0,
                      },
                    },
                  },
                ],
              },
            ],
            // 各环节完成情况数据
            stageProgressList: [
              {
                stageName: '采购立项及采购需求文件编制',
                totalProjects: 15,
                completedProjects: 12,
                inProgressProjects: 2,
                overdueProjects: 1,
                completionRate: 80,
                avgDuration: 3.5,
                overdueRate: 6.7,
              },
              {
                stageName: '集中采购需求申请接收',
                totalProjects: 15,
                completedProjects: 14,
                inProgressProjects: 1,
                overdueProjects: 0,
                completionRate: 93.3,
                avgDuration: 2.1,
                overdueRate: 0,
              },
              {
                stageName: '采购方案制订',
                totalProjects: 15,
                completedProjects: 10,
                inProgressProjects: 3,
                overdueProjects: 2,
                completionRate: 66.7,
                avgDuration: 4.2,
                overdueRate: 13.3,
              },
              {
                stageName: '采购方案审批',
                totalProjects: 15,
                completedProjects: 13,
                inProgressProjects: 2,
                overdueProjects: 0,
                completionRate: 86.7,
                avgDuration: 2.8,
                overdueRate: 0,
              },
              {
                stageName: '公告公示发布',
                totalProjects: 15,
                completedProjects: 14,
                inProgressProjects: 1,
                overdueProjects: 0,
                completionRate: 93.3,
                avgDuration: 1.5,
                overdueRate: 0,
              },
              {
                stageName: '采购项目实施',
                totalProjects: 15,
                completedProjects: 8,
                inProgressProjects: 5,
                overdueProjects: 2,
                completionRate: 53.3,
                avgDuration: 7.2,
                overdueRate: 13.3,
              },
              {
                stageName: '采购结果撰写',
                totalProjects: 15,
                completedProjects: 11,
                inProgressProjects: 3,
                overdueProjects: 1,
                completionRate: 73.3,
                avgDuration: 2.5,
                overdueRate: 6.7,
              },
              {
                stageName: '采购结果审批',
                totalProjects: 15,
                completedProjects: 12,
                inProgressProjects: 2,
                overdueProjects: 1,
                completionRate: 80,
                avgDuration: 3.1,
                overdueRate: 6.7,
              },
              {
                stageName: '采购结果公示发布',
                totalProjects: 15,
                completedProjects: 13,
                inProgressProjects: 2,
                overdueProjects: 0,
                completionRate: 86.7,
                avgDuration: 1.8,
                overdueRate: 0,
              },
              {
                stageName: '合同拟定',
                totalProjects: 15,
                completedProjects: 9,
                inProgressProjects: 4,
                overdueProjects: 2,
                completionRate: 60,
                avgDuration: 4.5,
                overdueRate: 13.3,
              },
              {
                stageName: '合同会签',
                totalProjects: 15,
                completedProjects: 10,
                inProgressProjects: 3,
                overdueProjects: 2,
                completionRate: 66.7,
                avgDuration: 3.8,
                overdueRate: 13.3,
              },
              {
                stageName: '合同法律审查',
                totalProjects: 15,
                completedProjects: 11,
                inProgressProjects: 3,
                overdueProjects: 1,
                completionRate: 73.3,
                avgDuration: 2.9,
                overdueRate: 6.7,
              },
              {
                stageName: '合同文本审定及用印',
                totalProjects: 15,
                completedProjects: 12,
                inProgressProjects: 2,
                overdueProjects: 1,
                completionRate: 80,
                avgDuration: 2.3,
                overdueRate: 6.7,
              },
              {
                stageName: '合同寄收',
                totalProjects: 15,
                completedProjects: 13,
                inProgressProjects: 2,
                overdueProjects: 0,
                completionRate: 86.7,
                avgDuration: 1.9,
                overdueRate: 0,
              },
            ],
            detailStatsPagination: {
              currentPage: 1,
              pageSize: 10,
              total: 3,
            },
            detailStatsSummary: {
              totalProjects: 15,
              overdueProjects: 3,
              totalBudget: 3500,
              usedBudget: 2100,
              avgProgress: 68,
              completionRate: 60,
            },
            // 预警统计页面数据
            warningSummary: {
              generalWarning: 10,
              abnormalWarning: 5,
              totalWarnings: 15,
            },
            warningFilter: {
              level: '',
              type: '',
              status: '',
            },
            warningList: [
              {
                projectName: '江苏省分行办公设备采购项目',
                level: '异常预警',
                description: '已超期 2 天未处理',
                createTime: '2024-02-20 09:30:00',
                deadline: '2024-02-25 18:00:00',
                status: '未处理',
                handler: '',
              },
              {
                projectName: '江苏省分行安防系统采购项目',
                level: '一般预警',
                description: '提前 1 天提醒',
                createTime: '2024-02-18 14:20:00',
                deadline: '2024-02-28 18:00:00',
                status: '处理中',
                handler: '李经理',
              },
              {
                projectName: '江苏省分行网络设备升级项目',
                level: '一般预警',
                description: '提前 1 天提醒',
                createTime: '2024-02-15 16:45:00',
                deadline: '2024-03-01 18:00:00',
                status: '已处理',
                handler: '王经理',
              },
            ],
            warningPagination: {
              currentPage: 1,
              pageSize: 10,
              total: 3,
            },
            // 环节时限配置页面数据
            globalTimeUnit: '工作日', // 全局时间单位
            timeConfigData: [
              {
                stage: '采购立项及采购需求文件编制',
                timeUnit: '工作日',
                openTender: 5,
                openCompetitiveConsultation: 3,
                openCompetitiveNegotiation: 3,
                openComparison: 3,
                openInquiry: 2,
                invitedTender: 3,
                invitedCompetitiveConsultation: 2,
                invitedCompetitiveNegotiation: 2,
                invitedComparison: 2,
                invitedInquiry: 1,
                singleSource: 1,
              },
              {
                stage: '集中采购需求申请接收',
                timeUnit: '工作日',
                openTender: 1,
                openCompetitiveConsultation: 1,
                openCompetitiveNegotiation: 1,
                openComparison: 1,
                openInquiry: 1,
                invitedTender: 1,
                invitedCompetitiveConsultation: 1,
                invitedCompetitiveNegotiation: 1,
                invitedComparison: 1,
                invitedInquiry: 1,
                singleSource: 1,
              },
              {
                stage: '采购方案制订',
                timeUnit: '工作日',
                openTender: 7,
                openCompetitiveConsultation: 5,
                openCompetitiveNegotiation: 5,
                openComparison: 5,
                openInquiry: 3,
                invitedTender: 5,
                invitedCompetitiveConsultation: 3,
                invitedCompetitiveNegotiation: 3,
                invitedComparison: 3,
                invitedInquiry: 2,
                singleSource: 2,
              },
              {
                stage: '采购方案审批',
                timeUnit: '工作日',
                openTender: 3,
                openCompetitiveConsultation: 2,
                openCompetitiveNegotiation: 2,
                openComparison: 2,
                openInquiry: 1,
                invitedTender: 2,
                invitedCompetitiveConsultation: 1,
                invitedCompetitiveNegotiation: 1,
                invitedComparison: 1,
                invitedInquiry: 1,
                singleSource: 1,
                // 采购方案审批特殊字段 - 签报审批
                openTenderReport: 2,
                openCompetitiveConsultationReport: 1,
                openCompetitiveNegotiationReport: 1,
                openComparisonReport: 1,
                openInquiryReport: 1,
                invitedTenderReport: 1,
                invitedCompetitiveConsultationReport: 1,
                invitedCompetitiveNegotiationReport: 1,
                invitedComparisonReport: 1,
                invitedInquiryReport: 1,
                singleSourceReport: 1,
                // 采购方案审批特殊字段 - 上会审批
                openTenderMeeting: 1,
                openCompetitiveConsultationMeeting: 1,
                openCompetitiveNegotiationMeeting: 1,
                openComparisonMeeting: 1,
                openInquiryMeeting: 0,
                invitedTenderMeeting: 1,
                invitedCompetitiveConsultationMeeting: 0,
                invitedCompetitiveNegotiationMeeting: 0,
                invitedComparisonMeeting: 0,
                invitedInquiryMeeting: 0,
                singleSourceMeeting: 0,
              },
              {
                stage: '公告公示发布',
                timeUnit: '工作日',
                openTender: 20,
                openCompetitiveConsultation: 15,
                openCompetitiveNegotiation: 15,
                openComparison: 15,
                openInquiry: 10,
                invitedTender: 15,
                invitedCompetitiveConsultation: 10,
                invitedCompetitiveNegotiation: 10,
                invitedComparison: 10,
                invitedInquiry: 7,
                singleSource: 5,
              },
              {
                stage: '采购项目实施',
                timeUnit: '工作日',
                openTender: 30,
                openCompetitiveConsultation: 20,
                openCompetitiveNegotiation: 20,
                openComparison: 20,
                openInquiry: 15,
                invitedTender: 20,
                invitedCompetitiveConsultation: 15,
                invitedCompetitiveNegotiation: 15,
                invitedComparison: 15,
                invitedInquiry: 10,
                singleSource: 7,
              },
              {
                stage: '采购结果撰写',
                timeUnit: '工作日',
                openTender: 5,
                openCompetitiveConsultation: 3,
                openCompetitiveNegotiation: 3,
                openComparison: 3,
                openInquiry: 2,
                invitedTender: 3,
                invitedCompetitiveConsultation: 2,
                invitedCompetitiveNegotiation: 2,
                invitedComparison: 2,
                invitedInquiry: 1,
                singleSource: 1,
              },
              {
                stage: '采购结果审批',
                timeUnit: '工作日',
                openTender: 3,
                openCompetitiveConsultation: 2,
                openCompetitiveNegotiation: 2,
                openComparison: 2,
                openInquiry: 1,
                invitedTender: 2,
                invitedCompetitiveConsultation: 1,
                invitedCompetitiveNegotiation: 1,
                invitedComparison: 1,
                invitedInquiry: 1,
                singleSource: 1,
              },
              {
                stage: '采购结果公示发布',
                timeUnit: '工作日',
                openTender: 7,
                openCompetitiveConsultation: 5,
                openCompetitiveNegotiation: 5,
                openComparison: 5,
                openInquiry: 3,
                invitedTender: 5,
                invitedCompetitiveConsultation: 3,
                invitedCompetitiveNegotiation: 3,
                invitedComparison: 3,
                invitedInquiry: 2,
                singleSource: 2,
              },
              {
                stage: '合同拟定',
                openTender: 7,
                openCompetitiveConsultation: 5,
                openCompetitiveNegotiation: 5,
                openComparison: 5,
                openInquiry: 3,
                invitedTender: 5,
                invitedCompetitiveConsultation: 3,
                invitedCompetitiveNegotiation: 3,
                invitedComparison: 3,
                invitedInquiry: 2,
                singleSource: 2,
              },
              {
                stage: '合同会签',
                openTender: 5,
                openCompetitiveConsultation: 3,
                openCompetitiveNegotiation: 3,
                openComparison: 3,
                openInquiry: 2,
                invitedTender: 3,
                invitedCompetitiveConsultation: 2,
                invitedCompetitiveNegotiation: 2,
                invitedComparison: 2,
                invitedInquiry: 1,
                singleSource: 1,
              },
              {
                stage: '合同法律审查',
                openTender: 3,
                openCompetitiveConsultation: 2,
                openCompetitiveNegotiation: 2,
                openComparison: 2,
                openInquiry: 1,
                invitedTender: 2,
                invitedCompetitiveConsultation: 1,
                invitedCompetitiveNegotiation: 1,
                invitedComparison: 1,
                invitedInquiry: 1,
                singleSource: 1,
              },
              {
                stage: '合同文本审定及用印',
                openTender: 3,
                openCompetitiveConsultation: 2,
                openCompetitiveNegotiation: 2,
                openComparison: 2,
                openInquiry: 1,
                invitedTender: 2,
                invitedCompetitiveConsultation: 1,
                invitedCompetitiveNegotiation: 1,
                invitedComparison: 1,
                invitedInquiry: 1,
                singleSource: 1,
              },
              {
                stage: '合同寄收',
                openTender: 5,
                openCompetitiveConsultation: 3,
                openCompetitiveNegotiation: 3,
                openComparison: 3,
                openInquiry: 2,
                invitedTender: 3,
                invitedCompetitiveConsultation: 2,
                invitedCompetitiveNegotiation: 2,
                invitedComparison: 2,
                invitedInquiry: 1,
                singleSource: 1,
              },
            ],
            configHistory: [
              {
                updateTime: '2024-02-20 14:30:00',
                operator: '张管理员',
                stage: '采购立项及采购需求文件编制',
                changeType: '修改',
                changes: '公开招标时限从3天调整为5天',
              },
              {
                updateTime: '2024-02-18 09:15:00',
                operator: '李管理员',
                stage: '采购方案制订',
                changeType: '新增',
                changes: '新增邀请竞争性磋商方式配置',
              },
              {
                updateTime: '2024-02-15 16:20:00',
                operator: '王管理员',
                stage: '采购项目实施',
                changeType: '修改',
                changes: '公开招标时限从25天调整为30天',
              },
              {
                updateTime: '2024-02-12 10:45:00',
                operator: '赵管理员',
                stage: '合同拟定',
                changeType: '修改',
                changes: '单一来源时限从1天调整为2天',
              },
            ],
            // 招标代理管理页面数据
            agentFilter: {
              name: '',
              level: '',
              status: '',
            },
            agentList: [
              {
                name: '江苏招标代理有限公司',
                code: 'DL2024001',
                level: '甲级',
                contactPerson: '张经理',
                phone: '138****5678',
                email: 'zhang@jszb.com',
                address: '江苏省南京市建邺区',
                status: '正常',
                projectCount: 25,
                winRate: 85,
              },
              {
                name: '南京采购咨询公司',
                code: 'DL2024002',
                level: '乙级',
                contactPerson: '李经理',
                phone: '139****1234',
                email: 'li@njcg.com',
                address: '江苏省南京市鼓楼区',
                status: '正常',
                projectCount: 18,
                winRate: 72,
              },
              {
                name: '苏州招标服务公司',
                code: 'DL2024003',
                level: '丙级',
                contactPerson: '王经理',
                phone: '137****9876',
                email: 'wang@szzb.com',
                address: '江苏省苏州市姑苏区',
                status: '暂停',
                projectCount: 8,
                winRate: 58,
              },
            ],
            agentPagination: {
              currentPage: 1,
              pageSize: 10,
              total: 3,
            },
            selectedAgents: [],
            pauseAgentDialog: {
              visible: false,
              currentAgent: null,
              form: {
                startTime: '',
                endTime: '',
                reason: '',
              },
            },
            // 用户权限管理页面数据
            userFilter: {
              username: '',
              realName: '',
              role: '',
              status: '',
            },
            userList: [
              {
                username: 'admin',
                realName: '系统管理员',
                email: 'admin@bank.com',
                phone: '138****0001',
                department: '信息部',
                role: 'admin',
                status: '正常',
                lastLoginTime: '2024-02-20 16:30:00',
                createTime: '2024-01-01 09:00:00',
              },
              {
                username: 'zhang.manager',
                realName: '张经理',
                email: 'zhang@bank.com',
                phone: '138****0002',
                department: '采购部',
                role: 'manager',
                status: '正常',
                lastLoginTime: '2024-02-20 15:45:00',
                createTime: '2024-01-05 10:30:00',
              },
              {
                username: 'li.buyer',
                realName: '李采购员',
                email: 'li@bank.com',
                phone: '138****0003',
                department: '采购部',
                role: 'buyer',
                status: '正常',
                lastLoginTime: '2024-02-20 14:20:00',
                createTime: '2024-01-10 11:15:00',
              },
              {
                username: 'wang.finance',
                realName: '王财务',
                email: 'wang@bank.com',
                phone: '138****0004',
                department: '财务部',
                role: 'finance',
                status: '正常',
                lastLoginTime: '2024-02-19 16:00:00',
                createTime: '2024-01-15 14:20:00',
              },
              {
                username: 'zhao.user',
                realName: '赵用户',
                email: 'zhao@bank.com',
                phone: '138****0005',
                department: '技术部',
                role: 'user',
                status: '禁用',
                lastLoginTime: '2024-02-15 09:30:00',
                createTime: '2024-01-20 16:45:00',
              },
            ],
            userPagination: {
              currentPage: 1,
              pageSize: 10,
              total: 5,
            },
            selectedUsers: [],
          }
        },
        methods: {
          switchPage(page) {
            this.currentPage = page
            this.updateBreadcrumb(page)
            // 如果切换到汇总统计页面，初始化图表
            if (page === 'summary-stats') {
              this.$nextTick(() => {
                this.initCharts()
              })
            }
          },
          updateBreadcrumb(page) {
            const breadcrumbMap = {
              'project-list': { main: '项目管理', sub: '项目列表' },
              'project-create': { main: '项目管理', sub: '新建项目' },
              'project-detail': { main: '项目管理', sub: '项目详情' },
              'summary-stats': { main: '统计分析', sub: '汇总统计' },
              'detail-stats': { main: '统计分析', sub: '明细统计' },
              'warning-stats': { main: '统计分析', sub: '预警统计' },
              'time-config': { main: '系统配置', sub: '环节时限配置' },
              'agent-management': { main: '系统配置', sub: '招标代理管理' },
              'user-management': { main: '系统配置', sub: '用户权限管理' },
            }
            this.breadcrumb = breadcrumbMap[page] || { main: '系统', sub: '' }
          },
          getPageTitle() {
            const titleMap = {
              'project-list': '项目列表',
              'project-create': '新建项目',
              'project-detail': '项目详情',
              'summary-stats': '汇总统计',
              'detail-stats': '明细统计',
              'warning-stats': '预警统计',
              'time-config': '环节时限配置',
              'agent-management': '招标代理管理',
              'user-management': '用户权限管理',
            }
            return titleMap[this.currentPage] || '未知页面'
          },
          handleSearch() {
            console.log('搜索条件:', this.searchForm)
            // 这里实现搜索逻辑
          },
          handleReset() {
            this.searchForm = {
              keyword: '',
              status: '',
              type: '',
            }
          },
          handleSizeChange(val) {
            this.pagination.pageSize = val
          },
          handleCurrentChange(val) {
            this.pagination.currentPage = val
          },
          viewProject(row) {
            console.log('查看项目:', row)
            this.switchPage('project-detail')
          },
          editProject(row) {
            console.log('编辑项目:', row)
            this.switchPage('project-create')
          },
          deleteProject(row) {
            this.$confirm('此操作将永久删除该项目, 是否继续?', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning',
            })
              .then(() => {
                this.$message({
                  type: 'success',
                  message: '删除成功!',
                })
              })
              .catch(() => {
                this.$message({
                  type: 'info',
                  message: '已取消删除',
                })
              })
          },
          rejectProject(row) {
            this.$confirm('确认将该项目标记为流标?', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning',
            }).then(() => {
              this.$message.success('项目已标记为流标')
            })
          },
          getStatusType(status) {
            const statusMap = {
              进行中: 'primary',
              已完成: 'success',
              已暂停: 'warning',
            }
            return statusMap[status] || 'info'
          },
          getProgressColor(percentage) {
            if (percentage >= 80) {
              return '#67c23a'
            } else if (percentage >= 60) {
              return '#e6a23c'
            } else {
              return '#f56c6c'
            }
          },
          getStageStatusType(status) {
            const statusMap = {
              已完成: 'success',
              进行中: 'primary',
              未开始: 'info',
              超时: 'danger',
            }
            return statusMap[status] || 'info'
          },
          getStageRowClassName({ row }) {
            // 检查是否有超时环节
            for (let stageKey in row.stages) {
              if (row.stages[stageKey].isOverdue) {
                return 'overdue-row'
              }
            }
            return ''
          },
          viewStageDetail(row) {
            this.$message.info(`查看 ${row.projectName} 的环节详情`)
            // 这里可以打开弹窗或跳转到详情页面
          },
          nextStep() {
            // 直接进入下一步，不进行校验
            this.createStep++
          },
          prevStep() {
            this.createStep--
          },
          toggleModifyReason() {
            this.showModifyReason = !this.showModifyReason
            if (!this.showModifyReason) {
              this.modifyReason = ''
            }
          },
          getAgentName(agentId) {
            const agent = this.agentOptions.find((a) => a.id === agentId)
            return agent ? agent.name : ''
          },
          getAgentLevel(agentId) {
            const agent = this.agentOptions.find((a) => a.id === agentId)
            return agent ? agent.level : ''
          },
          getSelectedAgentsNames() {
            return this.selectedAgents
              .map((id) => {
                const agent = this.agentOptions.find((a) => a.id === id)
                return agent ? agent.name : ''
              })
              .join('、')
          },
          getSelectedAgentsLevels() {
            return this.selectedAgents
              .map((id) => {
                const agent = this.agentOptions.find((a) => a.id === id)
                return agent ? agent.level : ''
              })
              .join('、')
          },
          saveAndRandomGroup() {
            // 保存项目基本信息并随机分配责任组
            this.$confirm('确认保存项目信息并随机分配责任组?', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning',
            }).then(() => {
              this.$message.success('项目信息保存成功，已随机分配责任组')
              this.createStep = 1 // 进入第二步
            })
          },
          submitProject() {
            this.$confirm('确认提交项目信息?', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning',
            }).then(() => {
              this.$message.success('项目提交成功')
              this.switchPage('project-list')
            })
          },
          goBack() {
            this.$confirm('确认取消创建项目?', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning',
            }).then(() => {
              this.switchPage('project-list')
            })
          },
          addSubProject() {
            this.$prompt('请输入子项目名称', '添加子项目', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
            }).then(({ value }) => {
              this.subProjects.push({
                name: value,
                type: '公开招标',
                budget: '100',
                manager: '待分配',
                department: '采购部',
                startDate: '2024-03-01',
                endDate: '2024-03-31',
                status: '待开始',
                progress: 0,
              })
              this.$message.success('子项目添加成功')
            })
          },
          removeSubProject(index) {
            this.$confirm('确认删除该子项目?', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning',
            }).then(() => {
              this.subProjects.splice(index, 1)
              this.$message.success('删除成功')
            })
          },
          viewSubProject(row) {
            console.log('查看子项目:', row)
          },
          editSubProject(row) {
            console.log('编辑子项目:', row)
          },
          initCharts() {
            // 若相关容器不存在则跳过，避免报错
            const statusEl = document.getElementById('statusChart')
            if (statusEl) {
              const statusChart = echarts.init(statusEl)
              const statusOption = {
                title: {
                  text: '项目状态分布',
                  left: 'center',
                },
                tooltip: {
                  trigger: 'item',
                  formatter: '{a} <br/>{b}: {c} ({d}%)',
                },
                legend: {
                  orient: 'vertical',
                  left: 'left',
                },
                series: [
                  {
                    name: '项目状态',
                    type: 'pie',
                    radius: '50%',
                    data: [
                      { value: 8, name: '进行中', itemStyle: { color: '#409EFF' } },
                      { value: 5, name: '已完成', itemStyle: { color: '#67C23A' } },
                      { value: 2, name: '已暂停', itemStyle: { color: '#E6A23C' } },
                    ],
                    emphasis: {
                      itemStyle: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)',
                      },
                    },
                  },
                ],
              }
              statusChart.setOption(statusOption)
            }

            // 各环节延时率对比柱状图
            const delayRateEl = document.getElementById('delayRateChart')
            if (delayRateEl) {
              const delayRateChart = echarts.init(delayRateEl)
              const delayRateOption = {
                title: {
                  text: '各环节延时率对比',
                  left: 'center',
                },
                tooltip: {
                  trigger: 'axis',
                },
                xAxis: {
                  type: 'category',
                  data: [
                    '采购立项',
                    '需求申请',
                    '方案制订',
                    '方案审批',
                    '公告发布',
                    '项目实施',
                    '结果撰写',
                    '结果审批',
                    '结果公示',
                    '合同拟定',
                    '合同会签',
                    '法律审查',
                    '文本审定',
                    '合同寄收',
                  ],
                  axisLabel: {
                    rotate: 45,
                  },
                },
                yAxis: {
                  type: 'value',
                  name: '延时率(%)',
                },
                series: [
                  {
                    name: '延时率',
                    type: 'bar',
                    data: [5, 8, 12, 3, 2, 15, 6, 4, 1, 8, 10, 7, 5, 3],
                    itemStyle: {
                      color: '#ff6b6b',
                    },
                  },
                ],
              }
              delayRateChart.setOption(delayRateOption)
            }

            // 各环节延时数量对比柱状图
            const delayCountEl = document.getElementById('delayCountChart')
            if (delayCountEl) {
              const delayCountChart = echarts.init(delayCountEl)
              const delayCountOption = {
                title: {
                  text: '各环节延时数量对比',
                  left: 'center',
                },
                tooltip: {
                  trigger: 'axis',
                },
                xAxis: {
                  type: 'category',
                  data: [
                    '采购立项',
                    '需求申请',
                    '方案制订',
                    '方案审批',
                    '公告发布',
                    '项目实施',
                    '结果撰写',
                    '结果审批',
                    '结果公示',
                    '合同拟定',
                    '合同会签',
                    '法律审查',
                    '文本审定',
                    '合同寄收',
                  ],
                  axisLabel: {
                    rotate: 45,
                  },
                },
                yAxis: {
                  type: 'value',
                  name: '延时数量(个)',
                },
                series: [
                  {
                    name: '延时数量',
                    type: 'bar',
                    data: [1, 2, 3, 1, 1, 4, 2, 1, 1, 2, 3, 2, 1, 1],
                    itemStyle: {
                      color: '#4ecdc4',
                    },
                  },
                ],
              }
              delayCountChart.setOption(delayCountOption)
            }

            // 部门项目分布柱状图
            const departmentEl = document.getElementById('departmentChart')
            if (departmentEl) {
              const departmentChart = echarts.init(departmentEl)
              const departmentOption = {
                title: {
                  text: '部门项目分布',
                  left: 'center',
                },
                tooltip: {
                  trigger: 'axis',
                  axisPointer: {
                    type: 'shadow',
                  },
                },
                xAxis: {
                  type: 'category',
                  data: ['采购部', '技术部', '财务部', '安全部'],
                },
                yAxis: {
                  type: 'value',
                },
                series: [
                  {
                    name: '项目数量',
                    type: 'bar',
                    data: [8, 4, 2, 1],
                    itemStyle: {
                      color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                        { offset: 0, color: '#83bff6' },
                        { offset: 0.5, color: '#188df0' },
                        { offset: 1, color: '#188df0' },
                      ]),
                    },
                  },
                ],
              }
              departmentChart.setOption(departmentOption)
            }

            // 采购方式统计环形图
            const methodEl = document.getElementById('methodChart')
            if (methodEl) {
              const methodChart = echarts.init(methodEl)
              const methodOption = {
                title: {
                  text: '采购方式统计',
                  left: 'center',
                },
                tooltip: {
                  trigger: 'item',
                  formatter: '{a} <br/>{b}: {c} ({d}%)',
                },
                legend: {
                  orient: 'vertical',
                  left: 'left',
                },
                series: [
                  {
                    name: '采购方式',
                    type: 'pie',
                    radius: ['40%', '70%'],
                    avoidLabelOverlap: false,
                    data: [
                      { value: 8, name: '公开招标', itemStyle: { color: '#409EFF' } },
                      { value: 4, name: '邀请招标', itemStyle: { color: '#67C23A' } },
                      { value: 2, name: '竞争性谈判', itemStyle: { color: '#E6A23C' } },
                      { value: 1, name: '单一来源', itemStyle: { color: '#F56C6C' } },
                    ],
                    emphasis: {
                      itemStyle: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)',
                      },
                    },
                  },
                ],
              }
              methodChart.setOption(methodOption)
            }

            // 响应式调整
            window.addEventListener('resize', function () {
              const charts = [
                'statusChart',
                'delayRateChart',
                'delayCountChart',
                'departmentChart',
                'methodChart',
              ]
              charts.forEach((id) => {
                const el = document.getElementById(id)
                if (el && el.__chart__) {
                  el.__chart__.resize()
                }
              })
            })
          },
          // 明细统计页面方法
          handleDetailStatsSearch() {
            console.log('明细统计搜索:', this.detailStatsFilter)
          },
          handleDetailStatsReset() {
            this.detailStatsFilter = {
              projectName: '',
              department: '',
              type: '',
              status: '',
            }
          },
          exportDetailStats() {
            this.$message.success('导出Excel功能开发中...')
          },
          addSavingColumn() {
            this.$message.success('增加一列节资率和节资金额功能开发中...')
          },
          getRowClassName({ row }) {
            if (row.overdueDays > 0) {
              return 'overdue-row'
            }
            return ''
          },
          viewProjectDetail(row) {
            console.log('查看项目详情:', row)
          },
          editProjectDetail(row) {
            console.log('编辑项目详情:', row)
          },
          handleDetailStatsSizeChange(val) {
            this.detailStatsPagination.pageSize = val
          },
          handleDetailStatsCurrentChange(val) {
            this.detailStatsPagination.currentPage = val
          },
          // 预警统计页面方法
          handleWarningSearch() {
            console.log('预警搜索:', this.warningFilter)
          },
          handleWarningReset() {
            this.warningFilter = {
              level: '',
              type: '',
              status: '',
            }
          },
          getWarningTypeTag(type) {
            const typeMap = {
              时间预警: 'danger',
              进度预警: 'warning',
              预算预警: 'info',
            }
            return typeMap[type] || 'info'
          },
          getWarningLevelClass(level) {
            const classMap = {
              一般预警: 'warning-general',
              异常预警: 'warning-abnormal',
            }
            return classMap[level] || 'warning-general'
          },
          getWarningStatusType(status) {
            const statusMap = {
              未处理: 'danger',
              处理中: 'warning',
              已处理: 'success',
            }
            return statusMap[status] || 'info'
          },
          viewWarningDetail(row) {
            console.log('查看预警详情:', row)
          },
          handleWarning(row) {
            this.$message.success('开始处理预警: ' + row.projectName)
          },
          resolveWarning(row) {
            this.$message.success('预警处理完成: ' + row.projectName)
          },
          handleWarningSizeChange(val) {
            this.warningPagination.pageSize = val
          },
          handleWarningCurrentChange(val) {
            this.warningPagination.currentPage = val
          },
          // 环节时限配置页面方法
          addTimeConfig() {
            this.$message.success('新增配置功能开发中...')
          },
          onTimeUnitChange(row) {
            console.log('时间单位变更:', row.stage, row.timeUnit)
          },
          // 项目创建页面事件处理
          onResponsibilityGroupChange(value) {
            if (value !== this.defaultResponsibilityGroup) {
              this.showResponsibilityModifyReason = true
            } else {
              this.showResponsibilityModifyReason = false
              this.responsibilityForm.modifyReason = ''
            }
          },
          onResponsiblePersonChange(value) {
            if (value !== this.defaultResponsiblePerson) {
              this.showResponsibilityModifyReason = true
            } else {
              this.showResponsibilityModifyReason = false
              this.responsibilityForm.modifyReason = ''
            }
          },
          onAgentCompanyChange(value) {
            if (value !== this.defaultAgentCompany) {
              this.showAgentModifyReason = true
            } else {
              this.showAgentModifyReason = false
              this.agentForm.modifyReason = ''
            }
          },
          saveAllConfigs() {
            this.$message.success('保存所有配置成功')
          },
          resetConfigs() {
            this.$confirm('确定要重置所有配置吗？', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning',
            })
              .then(() => {
                this.$message.success('配置已重置')
              })
              .catch(() => {})
          },
          validateTimeConfig(row, field) {
            // 对于采购方案审批的特殊字段，允许0值
            const isSpecialField = field.includes('Report') || field.includes('Meeting')
            const minValue = isSpecialField ? 0 : 1

            if (row[field] < minValue || row[field] > 365) {
              const message = isSpecialField ? '时限必须在0-365天之间' : '时限必须在1-365天之间'
              this.$message.warning(message)
              row[field] = Math.max(minValue, Math.min(365, row[field]))
            }
          },
          viewConfigHistory(row) {
            console.log('查看配置历史:', row)
          },
          // 招标代理管理页面方法
          handleAgentSearch() {
            console.log('代理搜索:', this.agentFilter)
          },
          handleAgentReset() {
            this.agentFilter = {
              name: '',
              level: '',
              status: '',
            }
          },
          addAgent() {
            this.$message.success('新增代理功能开发中...')
          },
          batchImportAgents() {
            this.$message.success('批量导入功能开发中...')
          },
          exportAgents() {
            this.$message.success('导出数据功能开发中...')
          },
          handleAgentSelectionChange(selection) {
            this.selectedAgents = selection
          },
          getAgentLevelType(level) {
            const levelMap = {
              甲级: 'success',
              乙级: 'warning',
              丙级: 'info',
            }
            return levelMap[level] || 'info'
          },
          getAgentStatusType(status) {
            const statusMap = {
              正常: 'success',
              暂停: 'warning',
              注销: 'danger',
            }
            return statusMap[status] || 'info'
          },
          viewAgent(row) {
            console.log('查看代理:', row)
          },
          editAgent(row) {
            console.log('编辑代理:', row)
          },
          toggleAgentStatus(row) {
            if (row.status === '正常') {
              // 暂停代理,弹出对话框
              this.pauseAgentDialog.currentAgent = row
              this.pauseAgentDialog.visible = true
              this.pauseAgentDialog.form = {
                startTime: '',
                endTime: '',
                reason: '',
              }
            } else {
              // 启用代理,直接确认
              this.$confirm('确认启用该代理?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning',
              }).then(() => {
                row.status = '正常'
                this.$message.success('代理已启用')
              })
            }
          },
          confirmPauseAgent() {
            // 验证必填字段
            if (
              !this.pauseAgentDialog.form.startTime ||
              !this.pauseAgentDialog.form.endTime ||
              !this.pauseAgentDialog.form.reason
            ) {
              this.$message.warning('请填写完整的暂停信息')
              return
            }
            // 验证结束时间晚于开始时间
            if (this.pauseAgentDialog.form.endTime <= this.pauseAgentDialog.form.startTime) {
              this.$message.warning('结束时间必须晚于开始时间')
              return
            }
            // 更新状态
            this.pauseAgentDialog.currentAgent.status = '暂停'
            this.pauseAgentDialog.visible = false
            this.$message.success('代理已暂停')
          },
          deleteAgent(row) {
            this.$confirm('确认删除该代理?', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning',
            }).then(() => {
              this.$message.success('删除成功')
            })
          },
          handleAgentSizeChange(val) {
            this.agentPagination.pageSize = val
          },
          handleAgentCurrentChange(val) {
            this.agentPagination.currentPage = val
          },
          // 用户权限管理页面方法
          handleUserSearch() {
            console.log('用户搜索:', this.userFilter)
          },
          handleUserReset() {
            this.userFilter = {
              username: '',
              realName: '',
              role: '',
              status: '',
            }
          },
          addUser() {
            this.$message.success('新增用户功能开发中...')
          },
          batchImportUsers() {
            this.$message.success('批量导入功能开发中...')
          },
          exportUsers() {
            this.$message.success('导出数据功能开发中...')
          },
          batchDeleteUsers() {
            this.$confirm(`确认删除选中的${this.selectedUsers.length}个用户?`, '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning',
            }).then(() => {
              this.$message.success('批量删除成功')
            })
          },
          handleUserSelectionChange(selection) {
            this.selectedUsers = selection
          },
          getRoleType(role) {
            const roleMap = {
              admin: 'danger',
              manager: 'primary',
              buyer: 'success',
              finance: 'warning',
              user: 'info',
            }
            return roleMap[role] || 'info'
          },
          getRoleName(role) {
            const roleNameMap = {
              admin: '系统管理员',
              manager: '采购经理',
              buyer: '采购员',
              finance: '财务人员',
              user: '普通用户',
            }
            return roleNameMap[role] || '未知角色'
          },
          getUserStatusType(status) {
            const statusMap = {
              正常: 'success',
              禁用: 'warning',
              锁定: 'danger',
            }
            return statusMap[status] || 'info'
          },
          viewUser(row) {
            console.log('查看用户:', row)
          },
          editUser(row) {
            console.log('编辑用户:', row)
          },
          resetPassword(row) {
            this.$confirm('确认重置该用户密码?', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning',
            }).then(() => {
              this.$message.success('密码重置成功')
            })
          },
          managePermissions(row) {
            this.$message.success('权限管理功能开发中...')
          },
          deleteUser(row) {
            this.$confirm('确认删除该用户?', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning',
            }).then(() => {
              this.$message.success('删除成功')
            })
          },
          handleUserSizeChange(val) {
            this.userPagination.pageSize = val
          },
          handleUserCurrentChange(val) {
            this.userPagination.currentPage = val
          },
        },
      })
    </script>
  </body>
</html>
